-->
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.  [ 4 posts ] 
Author Message
 Post subject: Resin 3 & TransactionException: could not register synch
PostPosted: Mon Dec 26, 2005 3:26 pm 
Newbie

Joined: Wed Sep 17, 2003 8:26 am
Posts: 16
Hi all,

I hope, this isn't obvious, as I've tried to solve this by myself:

I get the following exception:

org.hibernate.TransactionException: could not register synchronization
at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:309)
at org.hibernate.context.ThreadLocalSessionContext.currentSession(ThreadLocalSessionContext.java:78)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:506)
.
.
.
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.NullPointerException
at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:306)

in my webapp. AS is resin 3.0.16. I had no problems whatsoever with resin & hibernate 2.x but I'm porting to 3.1 right now. I traced with my debugger and have the following observation:
In registerSynchronization, line 306
getTransactionManager().getTransaction().registerSynchronization(sync);

getTransactionManager() returns an ImplClass from Resin and getTransaction() obviously returns null for the NPE. I have seen the creation of the Transaction in Hibernate, but I'm stuck here - should this Transaction be synched with a Transaction from Resin that isn't there? Is this perhaps a Bug in the Impl of the TransactionManager in Resin?

I have the following config:

<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.ResinTransactionManagerLookup</property>


Any help is appreciated!

Tia,

Jan


Top
 Profile  
 
 Post subject: Some more info
PostPosted: Mon Dec 26, 2005 3:37 pm 
Newbie

Joined: Wed Sep 17, 2003 8:26 am
Posts: 16
Some more info:

Getting the Transaction from JNDI/Resin obviously works:

2005-12-26 20:07:36,904 [resin-tcp-connection-*:8080-3] DEBUG org.hibernate.transaction.JTATransaction - Looking for UserTransaction under: java:comp/UserTransaction
2005-12-26 20:07:36,907 [resin-tcp-connection-*:8080-3] DEBUG org.hibernate.transaction.JTATransaction - Obtained UserTransaction

Jan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 2:36 pm 
Newbie

Joined: Wed Oct 25, 2006 3:26 pm
Posts: 7
Did you ever find a solution to this problem - I just tried the same thing with Resin 3.1 and got the same error:

org.hibernate.TransactionException: could not register synchronization
at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:309)
at org.hibernate.context.ThreadLocalSessionContext.currentSession(ThreadLocalSessionContext.java:78)

Caused by: java.lang.NullPointerException
at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:306)


Thanks,
-Mike


Top
 Profile  
 
 Post subject: Hmm
PostPosted: Thu Oct 30, 2008 3:06 pm 
Newbie

Joined: Thu Oct 30, 2008 2:16 pm
Posts: 3
I just ran into this problem before seeing this thread, and posted another topic:

http://forum.hibernate.org/viewtopic.php?t=991988


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