-->
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.  [ 2 posts ] 
Author Message
 Post subject: could not register synchronization with JTA TransactionManag
PostPosted: Tue Mar 29, 2005 3:47 am 
Newbie

Joined: Sat Mar 26, 2005 7:55 am
Posts: 5
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
2.1.7
Mapping documents:
there are about 8-9 of them , i can send those if needed
Code between sessionFactory.openSession() and session.close():
UserTransaction jtaTransaction = (UserTransaction)
ServiceLocator.getInstance()
.lookup(ServiceLocator.USER_TRANSACTION);
Transaction transaction = null;

try{
jtaTransaction.begin();
transaction = SessionManager.currentSession().beginTransaction();
// dao code
transaction.commit();
jtaTransaction.commit();
}catch(Exception e){
transaction.rollback();
jtaTransaction.rollback();
throw e;
}finally{
SessionManager.closeSession();
}
Full stack trace of any exception that occurs:
could not register synchronization with JTA TransactionManager
net.sf.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3357)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3321)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:66)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:779)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:265)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1553)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1530)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1526)
at scratch.BasicTasks.loadCompanyByName(BasicTasks.java:159)
at persistence.dataaccess.CompanyDataDAOTest.testInitializeCategories(CompanyDataDAOTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at junit.framework.TestCase.runTest(TestCase.java:154)
Name and version of the database you are using:
MySQL 4.1
The generated SQL (show_sql=true):
not relevant
Debug level Hibernate log excerpt:

intermittently i keep getting this problem while running my unit test cases.
As you can see i am using UserTransaction in JBoss 4.0.1
The SessionManager class is the one i picked up from Hibernate site for maintaining a session per thread (here per http request).

The hibernate is not deployed as a jboss service , i am packaging all the relevant jars with my ear package.

any help would be great .

thanks.
manu


Top
 Profile  
 
 Post subject: please help !
PostPosted: Tue Mar 29, 2005 7:33 am 
Newbie

Joined: Sat Mar 26, 2005 7:55 am
Posts: 5
please , i need a solution to this problem :-)

manu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.