1. CMT and session factory look up forum.hibernate.orgDear All, Supposing the transaction is to be managed by container (CMT), as advised by the hibernate team and this forum participant , there is no need to write any code to perform the client-demarcated JTA JNDI lookup such as UserTransaction tx=(UserTransaction) ctx.lookup("UserTransaction"); I am a bit confused as to whether the session obtaind through SessionFactory JNDI look up is a ... |
2. CMT SSLB and Session forum.hibernate.orgHibernate 2.1.4 , Jboss 3.2.5 I have developed an application consisting of SSLB using Hibernate as the persistence layer. Each method in the SSLB uses the ThreadLocal pattern to get the session and close the session in the finally clause. When a method doSomething() in SSLB1 calls method doThat() in SSLB2, I get the following error : 'Session is closed'. How ... |
3. CMT with hibernate session forum.hibernate.orgHow to make hibernate use existing Container Managed Transaction. Following is the code of my method which uses hibernate to save data. This is method in AccountSessionBean which uses Container Managed Transaction. public void insertAccount() throws Exception{ Session session = null; Transaction txn = null; try{ SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session = sessionFactory.getCurrentSession(); Account account = new Account(); account.setAccountID("2"); account.setAccountName("ADM"); ... |
4. Flushing Session by CMT forum.hibernate.orgHibernate version: 3.1.2 My Config: |
5. Websphere with CMT, getcurrentsession() is thread safe? forum.hibernate.orgpublic static Object getById(Session aSession, Long aId, Class aClass, boolean lock) throws HibernateException, DBONotFoundException { Object back = null; if (lock) ... |
6. session.close() in CMT enviroment forum.hibernate.orgWhen using JTA, the Session is closed automatically on commit. There is a danger in closing a session that is returned by getCurrentSession(). If you have 2 or more components involved in a transaction which load data via Hibernate. Suppose that component 1 loads data 1st and calls session.close(). When component 2 call getCurrentSession(), an exception will be thrown stating that ... |