-->
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: Problems with transactions in WAS when using hibernate
PostPosted: Wed Jan 12, 2005 7:18 am 
Newbie

Joined: Tue Jan 11, 2005 3:02 pm
Posts: 1
Hi guys,

I have had problems with hibernate 2 when using it in WAS 5.X. The problem concerns the management of transactions.
I have an EJB Session Bean method which requires a transaction. I have configured the .cfg.xml file to use JTATransactionFactory and a ConnectionProvider like this:

<!-- Part of my configuration file -->
<property name="connection.datasource">jdbc/qgraosDs</property>
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>
<property name="connection.provider_class">br.com.project.hibernate.websphere.WSDataSourceConnectionProvider</property>
<property name="jta.UserTransaction">jta/usertransaction</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>

... (the mappings)

I implemented a connection provider class - br.com.project.hibernate.websphere.WSDataSourceConnectionProvider - as specified in Wiki Community Area Hibernate in WAS 5.x - fixes possible deadlock problem ( http://www.hibernate.org/204.html ).

Well, I have done all this and, in my DAO layer and I call hibernate open session and begin transaction before perfoming any database method such as findBykey, create, and after I commit the transaction and close the session.

So here is the problem, specfically, I get the following error messages when executing:

O O contador da sessão session_oracle foi inicializado: 1
[1/12/05 8:39:17:734 BRST] 267c2e35 Helpers W NMSV0605W: A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jta/usertransaction" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.ejs.jts.jta.UtxJNDIFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object

Exception data follows:
javax.naming.ConfigurationException
at com.ibm.ejs.jts.jta.UtxJNDIFactory.getObjectInstance(UtxJNDIFactory.java:90)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)

...

[1/12/05 8:39:18:000 BRST] 267c2e35 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: lookup
Context name: localhost/nodes/localhost/servers/server1
Target name: jta/usertransaction
Other data:
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is javax.naming.ConfigurationException
at com.ibm.ejs.jts.jta.UtxJNDIFactory.getObjectInstance(UtxJNDIFactory.java:90)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)

....


[1/12/05 8:39:18:000 BRST] 267c2e35 JTATransactio E net.sf.hibernate.transaction.JTATransaction Could not find UserTransaction in JNDI
[1/12/05 8:39:18:016 BRST] 267c2e35 JTATransactio E net.sf.hibernate.transaction.JTATransaction TRAS0014I: The following exception was logged com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is javax.naming.ConfigurationException
at com.ibm.ejs.jts.jta.UtxJNDIFactory.getObjectInstance(UtxJNDIFactory.java:90)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
...

I have tried changing the jta.UserTransaction property in the cfg configuration file but still it hasn´t worked. I tried:

- <property name="jta.UserTransaction">jta/usertransaction</property>

- <property name="jta.UserTransaction">UserTransaction</property>

- <property name="jta.UserTransaction">comp/UserTransaction</property>

So, can anyone please help me, show me a light at the end of the tunnel. I really need this help.

Thanks,
Carol


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 6:13 pm 
Regular
Regular

Joined: Tue Jun 22, 2004 8:01 pm
Posts: 106
Location: PowderTown, Utah, USA
I've used the JTA Support for Hibernate in the Spring Framework and had it working just fine. Also, since JTA Support is part of Spring, their forum is a bit more active on the subject. Also, the Hibernate concepts in Spring are quite nice.


Top
 Profile  
 
 Post subject: Re: Problems with transactions in WAS when using hibernate
PostPosted: Tue Jun 29, 2010 10:02 am 
Newbie

Joined: Sat May 01, 2010 9:20 am
Posts: 6
Hey

I have the same problem with JTA transaction lookup

I tried all the combinations u have tried.

Did u find any solution for that

fyi I am using WAS 5


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.