Websphere « Session « JPA Q&A





1. Obtaining a new session from Hibernate for a background thread    stackoverflow.com

I'm working on a web application. Usually at the beginning of a request (through the architecture code), a Hibernate session is opened to work with DB transactions. At the end of ...

2. NPE hibernate session factory websphere portal    coderanch.com

I have a hibernate code snipped which works on websphere application server. However if I used the same hibernate code on websphere portal (6.0) I get the below stack trace: line 99 of HibernateUtil.java:99 is this.currentSession = sessionFactory.openSession(); ================================================================== 7/12/08 18:03:34:844 IST 000000eb SystemErr R java.lang.NullPointerException at au.gov.nsw.railcorp.common.service.util.HibernateUtil.openSession(HibernateUtil.java:99) at au.gov.nsw.railcorp.common.service.BaseService.openHibernateSession(BaseService.java:14) at au.gov.nsw.railcorp.healthassess.service.HaService.searchHA(HaService.java:213) at au.gov.nsw.railcorp.healthassess.view.SearchHAView.uiSearch(SearchHAView.java:251) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code)) at ...

3. JTASessionContext not removing session with WebSphere    forum.hibernate.org

Newbie Joined: Tue May 30, 2006 9:23 am Posts: 1 Hi The JTASessionContext implementation does not remove the session at the end of the transaction with WebSphere appserver 6. After looking into this a found that the transaction is stored as the key with the session in a map. The transaction is not immutable and therefore when it wants to remove ...

4. How do I initialize SessionFactory in Websphere 6.1 once?    forum.hibernate.org

Hi all, I am new to Hibernate and was wondering what best practice would be to create the Sessionfactory inside a J2EE project. After some reading and research on the net I saw that it is expensive to create the SessionFactory (makes sense to me). The question is, how to create it only once and then look it up by the ...

5. WebSphere 7 - Session injection problem    forum.hibernate.org

Upon initialization of a SLSB in WebSphere 7.0 I get the following exception: Code: [2.2.09 10:33:04:828 CET] 00000013 BusinessExcep E CNTR0019E: EJB threw an unexpected (non-declared) exception during invocation of method "ping". Exception data: javax.ejb.EJBException: Injection failure; nested exception is: java.lang.IllegalArgumentException: Can not set org.hibernate.Session field beans.TestBeanEJB.session to com.ibm.ws.jpa.management.JPATxEntityManager java.lang.IllegalArgumentException: Can not set org.hibernate.Session field beans.TestBeanEJB.session to com.ibm.ws.jpa.management.JPATxEntityManager ...