[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3110) JTATransaction could not find UserTransaction in JNDI when working with JOTM

Felix von Delius (JIRA) noreply at atlassian.com
Wed Mar 12 10:40:34 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29775 ] 

Felix von Delius commented on HHH-3110:
---------------------------------------

A possible workaround is to implement your own TransactionFactory and delegating to this factory in the hibernate configuration by setting the property "hibernate.transaction.factory_class" to this class.

In our case, we copied the code of hibernate's JTATransactionFactory and  JTATransaction to a JotmTransacrionFactory / JotmTransaction class and replaced the JNDI-Lookup in the constructor of JotmTransaction by this line:

    UserTransaction ut = Current.getCurrent();

(JotmTransactionFactory will use JotmTransaction instead of JTATransaction)

Hope this helps!


> JTATransaction could not find UserTransaction in JNDI when working with JOTM
> ----------------------------------------------------------------------------
>
>                 Key: HHH-3110
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3110
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.6
>         Environment: Hibernate 3.2.6, Oracle9i, jotm-2.0.10
>            Reporter: Felix von Delius
>            Assignee: Chris Bredesen
>            Priority: Critical
>
> In our local (out-of-container) environment, we use JTA with JOTM as the JTA implementation.
> It seems that the fix for HHH-1956 has this side effect, since I build a patched version of Hibernate-3.2.6 with the lazy initialization of hibernateTransaction commented out (lines 171-173 in JDBCContext.java).
> Here is the relevant part of the stacktrace caused by the problem:
> [ID:KxMaQ USER:\OPTIMMOSYS] 15:27:04,107 ERROR [JTATransaction] Could not find UserTransaction in JNDI
> javax.naming.NameNotFoundException
> at org.objectweb.carol.jndi.enc.java.CompNamingContext.lookupCtx(CompNamingContext.java:689)
> at org.objectweb.carol.jndi.enc.java.CompNamingContext.lookup(CompNamingContext.java:179)
> at org.objectweb.carol.jndi.enc.java.JavaURLContext.lookup(JavaURLContext.java:138)
> at javax.naming.InitialContext.lookup(InitialContext.java:361)
> at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60)
> at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:57)
> at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:172)
> at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:76)
> at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:213)
> at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:473)
> at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:497)
> at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:505)
> at com.ing.diba.mws.tcore.persistence.HibernateSessionSourceImpl.createPersistenceProvider(HibernateSessionSourceImpl.java:45) 
> Our configuration in this case contains:
> hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JOTMTransactionManagerLookup

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list