-->
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.  [ 10 posts ] 
Author Message
 Post subject: could not register synchronization with JTA TransactionMa...
PostPosted: Thu Oct 26, 2006 11:48 am 
Newbie

Joined: Fri Oct 20, 2006 5:47 am
Posts: 3
Location: Europe
Error "could not register synchronization with JTA TransactionManager" is upon openSession call.

Hibernate version:3.2
Websphere version:6.1.0.0
Oracle version:9i

Mapping documents:
Code:
    <session-factory>
        <property name="hibernate.session_factory_name">hibernate/Excom2HibernateFactory</property>
        <property name="hibernate.connection.datasource">jdbc/Excom2DS</property>
        <property name="show_sql">false</property>
        <property name="dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
        <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
        <property name="hibernate.transaction.flush_before_completion">true</property>
        <property name="hibernate.transaction.auto_close_session">true</property>
        <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
        <!-- Mapping files -->
        <mapping class="com.pxpfs.excom2.finance.domainmodel.AboImportHistory"/>
...



sessionFactory.openSession() produces next error

Full stack trace of any exception that occurs:
[10/26/06 16:32:00:384 CEST] 00000018 SystemOut O 16:32:00,383 ERROR [SessionDAO] org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
Stack trace is not available.


Debug level Hibernate log excerpt: there is no error in hibernate log with debug level, see:
2006-10-26 16:31:59,915 DEBUG [org.hibernate.loader.collection.OneToManyLoader] Static select for one-to-many com.pxpfs.excom2.finance.domainmodel.InstrumentFundStatic.payments: select payments0_.instrumentId as instrume2_1_, payments0_.id as id1_, payments0_.id as id82_0_, payments0_.instrumentId as instrume2_82_0_, payments0_.paymentDate as paymentD3_82_0_, payments0_.paymentAmount as paymentA4_82_0_ from INSTRUMENT_FUND_PAY_TBL payments0_ where payments0_.instrumentId=?
2006-10-26 16:31:59,918 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] initializing class SessionFactoryObjectFactory
2006-10-26 16:31:59,923 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] registered: 8a81834c0e8508bf010e8508daab0000 (hibernate/Excom2HibernateFactory)
2006-10-26 16:31:59,923 INFO [org.hibernate.impl.SessionFactoryObjectFactory] Factory name: hibernate/Excom2HibernateFactory
2006-10-26 16:31:59,924 INFO [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2006-10-26 16:31:59,924 DEBUG [org.hibernate.util.NamingHelper] binding: hibernate/Excom2HibernateFactory
2006-10-26 16:31:59,924 DEBUG [org.hibernate.impl.SessionFactoryImpl] Returning a Reference to the SessionFactory
2006-10-26 16:32:00,124 DEBUG [org.hibernate.util.NamingHelper] lookup: hibernate
2006-10-26 16:32:00,295 INFO [org.hibernate.util.NamingHelper] Creating subcontext: hibernate
2006-10-26 16:32:00,295 DEBUG [org.hibernate.util.NamingHelper] binding: Excom2HibernateFactory
2006-10-26 16:32:00,295 DEBUG [org.hibernate.impl.SessionFactoryImpl] Returning a Reference to the SessionFactory
2006-10-26 16:32:00,296 DEBUG [org.hibernate.util.NamingHelper] Bound name: hibernate/Excom2HibernateFactory
2006-10-26 16:32:00,296 INFO [org.hibernate.impl.SessionFactoryObjectFactory] Bound factory to JNDI name: hibernate/Excom2HibernateFactory
2006-10-26 16:32:00,297 WARN [org.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext
2006-10-26 16:32:00,297 DEBUG [org.hibernate.impl.SessionFactoryImpl] instantiated session factory
2006-10-26 16:32:00,297 DEBUG [org.hibernate.impl.SessionFactoryImpl] obtaining JTA TransactionManager
2006-10-26 16:32:00,305 DEBUG [org.hibernate.impl.SessionFactoryImpl] Checking 0 named HQL queries
2006-10-26 16:32:00,305 DEBUG [org.hibernate.impl.SessionFactoryImpl] Checking 0 named SQL queries



Problem seems to be in class WebSphereExtendedJTATransactionLookup:
Code:
      public int getStatus() throws SystemException {
         throw new UnsupportedOperationException();
      }


Top
 Profile  
 
 Post subject: More details
PostPosted: Thu Dec 21, 2006 10:10 am 
Newbie

Joined: Mon Dec 12, 2005 4:25 am
Posts: 6
I get the exact same behaviour. It works well with v3.1 but after upgrade to v3.2 it can't register with transaction manager. Problem seams to be within Hibernate, not WAS.

The change seams to be in JDBCContext.registerSynchronizationIfPossible that now calls JDBCContext.isTransactionInProgress that in turn calls JTATransactionFactory.isTransactionInProgress in which following code is executed:

Code:
if ( jdbcContext.getFactory().getTransactionManager() != null ) {
  return JTAHelper.isInProgress( jdbcContext.getFactory().getTransactionManager().getStatus() );
}


That seams ok, but since the WebSphereExtendedJTATransactionLookup class doesn't implement the getStatus method it fails.

Should initialization or configuration be made some other way in Hibernate v3.2 than 3.1? I have not found anything indicating this in the documentation.

Since v3.2 fixes some errors that we are dependent of it is important that a fix is found. Any help is apreciated.

Stacktrace:
Code:
Caused by: java.lang.UnsupportedOperationException
   at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:78)
   at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:94)
   at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
   at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:159)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 03, 2007 9:31 pm 
Newbie

Joined: Wed Jan 03, 2007 8:10 pm
Posts: 4
got a similar error:
Code:
[4/01/07 09:49:27:629 EST] 00000030 ServletWrappe E   SRVE0068E: Could not invoke the service() method on servlet PersistAudit. Exception thrown : org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
   at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java(Compiled Code))
   at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:76)
   at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:213)

Caused by: java.lang.UnsupportedOperationException
   at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:78)
   at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:94)


Even though I'm using WAS 6.0.2.13 changing transaction manager from org.hibernate.transaction.WebSphereExtendedJTATransactionLookup to org.hibernate.transaction.WebSphereTransactionManagerLookup worked.

Using hibernate 3.2.1.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 21, 2007 9:16 am 
Newbie

Joined: Wed Mar 21, 2007 9:11 am
Posts: 1
Me too:

Hibernate version:3.2.1
Websphere version:6.1
Oracle version:9i


Code:
Caused by:
java.lang.UnsupportedOperationException
        at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:78)
        at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:94)
        at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
        at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:159)
        ... 33 more


Did anyone found a solution?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 8:40 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
Old TransactionManager lookup strategy for WebSphere (versions 4, 5.0 and 5.1) - WebSphereTransactionManagerLookup works for WebSphere 6.x also, but i don't know is that correct to use old strategy for new WebSphere 6.x.

_________________
Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 5:36 am 
Newbie

Joined: Mon Apr 16, 2007 5:30 am
Posts: 1
WebSphereTransactionManagerLookup works for me with WebSphere 6.1 as well. Is there any news about whether it is ok to use it for WebSphere 6.1?


Top
 Profile  
 
 Post subject: are there any updates
PostPosted: Tue Jul 17, 2007 5:43 am 
Newbie

Joined: Tue Jul 17, 2007 5:27 am
Posts: 1
Hello everybody,
We've got exactly the same problems using
WebSphere 6.0 and WebSphere 6.1.0.5 and 6.1.0.9,
Hibernate V3.2.4.SP1
and Oracle 9i.
We do the following :

<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.session_factory_name">java:hibernate/SessionFactory</prop>
<prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</prop>
<prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</prop>
<prop key="jta.UserTransaction">java:comp/UserTransaction</prop>

Are there any updates to this Problem?
I don't know if using org.hibernate.transaction.WebSphereTransactionManagerLookup Class is supported or not.

Thanks so long


Top
 Profile  
 
 Post subject: Could not find UserTransaction in JNDI
PostPosted: Tue Jul 17, 2007 9:37 am 
Newbie

Joined: Thu Jun 28, 2007 9:39 am
Posts: 9
Error: [7/17/07 7:19:29:746 MDT] 2558db1a JTATransactio E org.hibernate.transaction.JTATransaction Could not find UserTransaction in JNDI

[7/17/07 7:19:29:761 MDT] 2558db1a JTATransactio E org.hibernate.transaction.JTATransaction TRAS0014I: The following exception was logged javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1021)

This error excuted in some of the java methods called.
The hibernate vesion we have used is 3.0, Was 5.1 and SQL Server 2000

Can any one hasve some soulution for this ?


Top
 Profile  
 
 Post subject: Any news?
PostPosted: Sun Mar 23, 2008 12:27 pm 
Beginner
Beginner

Joined: Thu Nov 13, 2003 4:12 am
Posts: 27
Hi,


I have exactly the same problem:

WebSphereExtendedJTATransactionLookup

doesn't work but

WebSphereJTATransactionLookup

works.

any news on this topic?
I'm using Hibernate 3.2.6 GA and the WAS 6.0.2.x

thanks


Top
 Profile  
 
 Post subject: Could not find UserTransaction in JNDI
PostPosted: Wed Apr 30, 2008 4:41 am 
Beginner
Beginner

Joined: Wed Aug 09, 2006 12:09 pm
Posts: 20
Location: Belgium
Has anyone found a solution for this yet?

I am on WAS 6.1 FP 15 using Hibernate 3.0

cheers
Martin


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