-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Transaction problems in Websphere 5.1.2
PostPosted: Thu Aug 19, 2004 3:36 am 
Newbie

Joined: Thu Aug 19, 2004 2:22 am
Posts: 2
Hi, All

I'm having trouble with Hibernate in Websphere 5.12. I used the simple Cats example in the manual to create a sample app which I access from a a session bean via the universal test client.

When I try to save a class websphere says:

DSRA9350E: Operation Connection.commit is not allowed during a global transaction.

The ONLY transaction configuration I have made is the folowing

hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.WebSphereTransactionManagerLookup

I can't figure this one out. Has anyone got any suggestions?

Justin

Hibernate version:
2.1.5
Hibernate version:
5.1.2

Code between sessionFactory.openSession() and session.close():

Transaction tx = null;
Cat cat = new Cat(new Date(System.currentTimeMillis()),"Pink",'m',2,null);
try {
tx = session.beginTransaction();
session.save(cat);
tx.commit();
}catch ( Exception he ) {
//if ( tx != null ) tx.rollback();
he.printStackTrace();
} finally {
session.close();
}


Full stack trace of any exception that occurs:
[04/08/19 08:52:19:968 CAT] 7f00dbda JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.commit(WSJdbcConnection.java:536)
at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:126)
at net.sf.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:59)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:765)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at com.softwarefutures.hibernate.HibernateSessionBean.createCat(HibernateSessionBean.java:29)
at com.softwarefutures.hibernate.EJSRemoteStatelessHibernateSession_3af29505.createCat(EJSRemoteStatelessHibernateSession_3af29505.java:22)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.CORBA.iiop.ClientDelegate$3.run(ClientDelegate.java:1144)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDelegate.java:1140)
at $Proxy9.createCat(Unknown Source)
at com.softwarefutures.hibernate._HibernateSession_Stub.createCat(_HibernateSession_Stub.java:252)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:68)
at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:110)
at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1020)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:561)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:198)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:80)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:212)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)

Name and version of the database you are using:
DB2 8

Debug level Hibernate log excerpt:

[04/08/19 08:52:18:671 CAT] 7f00dbda DatasourceCon I net.sf.hibernate.connection.DatasourceConnectionProvider Using datasource: jdbc/ds1
[04/08/19 08:52:18:671 CAT] 7f00dbda TransactionMa I net.sf.hibernate.transaction.TransactionManagerLookupFactory instantiating TransactionManagerLookup: net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
[04/08/19 08:52:18:687 CAT] 7f00dbda TransactionMa I net.sf.hibernate.transaction.TransactionManagerLookupFactory instantiated TransactionManagerLookup
[04/08/19 08:52:18:984 CAT] 7f00dbda WSRdbDataSour u Database version is
08.01.0005
[04/08/19 08:52:18:984 CAT] 7f00dbda WSRdbDataSour u JDBC Driver version is
08.01.0005
[04/08/19 08:52:18:999 CAT] 7f00dbda SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Use scrollable result sets: true
[04/08/19 08:52:18:999 CAT] 7f00dbda SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Use JDBC3 getGeneratedKeys(): false
[04/08/19 08:52:19:015 CAT] 7f00dbda SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Optimize cache for minimal puts: false
[04/08/19 08:52:19:015 CAT] 7f00dbda SettingsFacto I net.sf.hibernate.cfg.SettingsFactory Query language substitutions: {false=0, no='N', yes='Y', true=1}
[04/08/19 08:52:19:015 CAT] 7f00dbda SettingsFacto I net.sf.hibernate.cfg.SettingsFactory cache provider: net.sf.hibernate.cache.EhCacheProvider
[04/08/19 08:52:19:031 CAT] 7f00dbda SettingsFacto I net.sf.hibernate.cfg.SettingsFactory query cache factory: net.sf.hibernate.cache.StandardQueryCacheFactory
[04/08/19 08:52:19:031 CAT] 7f00dbda Configuration I net.sf.hibernate.cfg.Configuration instantiating and configuring caches
[04/08/19 08:52:19:156 CAT] 7f00dbda SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl building session factory
[04/08/19 08:52:19:765 CAT] 7f00dbda SessionFactor I net.sf.hibernate.impl.SessionFactoryObjectFactory Not binding factory to JNDI, no JNDI name configured
[04/08/19 08:52:19:765 CAT] 7f00dbda WebSphereTran I net.sf.hibernate.transaction.WebSphereTransactionManagerLookup WebSphere 5.0
[04/08/19 08:52:19:781 CAT] 7f00dbda UpdateTimesta I net.sf.hibernate.cache.UpdateTimestampsCache starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
[04/08/19 08:52:19:796 CAT] 7f00dbda Configurator W net.sf.ehcache.config.Configurator No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/java/hibernate-2.1/lib/ehcache-0.9.jar!/ehcache-failsafe.xml
[04/08/19 08:52:19:812 CAT] 7f00dbda EhCache W net.sf.hibernate.cache.EhCache Could not find configuration for net.sf.hibernate.cache.UpdateTimestampsCache. Configuring using the defaultCache settings.
[04/08/19 08:52:19:843 CAT] 7f00dbda StandardQuery I net.sf.hibernate.cache.StandardQueryCache starting query cache at region: net.sf.hibernate.cache.StandardQueryCache
[04/08/19 08:52:19:843 CAT] 7f00dbda EhCache W net.sf.hibernate.cache.EhCache Could not find configuration for net.sf.hibernate.cache.StandardQueryCache. Configuring using the defaultCache settings.
[04/08/19 08:52:19:921 CAT] 7f00dbda JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: 0, SQLState: null
[04/08/19 08:52:19:953 CAT] 7f00dbda JDBCException E net.sf.hibernate.util.JDBCExceptionReporter DSRA9350E: Operation Connection.commit is not allowed during a global transaction.
[04/08/19 08:52:19:953 CAT] 7f00dbda JDBCException E net.sf.hibernate.util.JDBCExceptionReporter Could not save object
[04/08/19 08:52:19:968 CAT] 7f00dbda JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged java.sql.SQLException: DSRA9350E: Operation Connection.commit is not allowed during a global transaction.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 1:50 pm 
Beginner
Beginner

Joined: Mon Mar 08, 2004 6:09 pm
Posts: 20
Did you solve this problem??.. how??


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 4:49 am 
Newbie

Joined: Thu Aug 19, 2004 2:22 am
Posts: 2
Yes I did. Good thing you posted this because I always meant to respond to my own post.

You must make sure that the property

#hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory

is UNcommented.

Then hit your forehead with your palm repeatedly :-)

PS I don't have that properties file with me now (and it's been a while) but I THINK it was that one, if you still get the same errors then post your props file.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.