CMT « Session « JPA Q&A





1. CMT and session factory look up    forum.hibernate.org

Dear 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.org

Hibernate 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.org

How 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.org

Hibernate version: 3.1.2 My Config: fcbk_hibernate_SessionFactory org.hibernate.transaction.WeblogicTransactionManagerLookup weblogic.jndi.WLInitialContextFactory org.hibernate.dialect.Oracle9Dialect t3://localhost:7001 org.hibernate.transaction.CMTTransactionFactory resolveDataSource org.hibernate.hql.classic.ClassicQueryTranslatorFactory true true Question: Am using EJB2 Session Bean for Transaction Mgmt with WebLogic Server 8.1 Sp3, and I'm not using any Transaction statements ...

5. Websphere with CMT, getcurrentsession() is thread safe?    forum.hibernate.org

public 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.org

When 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 ...