Hi,
I'm using Hibernate from EJB Session Bean on Websphere 6. I try to load data from database with Criteria API.
It's work perfectlly with 3.0.5, but if I change the hibernate jar with the version 3.1.3; I obtain an exception : org.hibernate.HibernateException: createCriteria is not valid without active transaction
I need Help, Thanks You.
Yann.
Hibernate version: 3.1.3
Mapping documents:<property name="transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">thisNode/servers/server1/jta/usertransaction</property>
Code between sessionFactory.openSession() and session.close():hsession = factory.getCurrentSession();
Criteria criteriaSuspiciousElement = hsession.createCriteria(MaTable.class);
criteriaSuspiciousElement.add(Expression.isNull("deletedDate"));
Full stack trace of any exception that occurs:
org.hibernate.HibernateException: createCriteria is not valid without active transaction
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297)
at $Proxy4.createCriteria(Unknown Source)
at com.pwc.lu.business.service.ejb.amlkyctool.BlackListManagerBean.getSuspisousElementByCriteria(BlackListManagerBean.java:186)
at com.pwc.lu.business.service.ejb.amlkyctool.EJSRemoteStatelessBlackListManager_4e15066b.getSuspisousElementByCriteria(EJSRemoteStatelessBlackListManager_4e15066b.java:114)
at com.pwc.lu.business.service.ejb.amlkyctool._BlackListManager_Stub.getSuspisousElementByCriteria(_BlackListManager_Stub.java:352)
at com.pwc.lu.web.amlkyctool.actions.blacklist.BlackListAction.execute(BlackListAction.java:31)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
Name and version of the database you are using: Oracle 9
|