-->
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.  [ 6 posts ] 
Author Message
 Post subject: transaction exception when using hibernate 3.2 with WAS6.0.2
PostPosted: Mon Dec 18, 2006 12:54 pm 
Newbie

Joined: Mon Dec 18, 2006 12:43 pm
Posts: 3
Hi,
I am getting problem with user transaction at the time server start. This problem is coming when hibernate session get closed. Details given below:-


Hibernate version: 3.2.0.cr3

Websphere version: 6.0.2

Mapping documents:
My Hibernate.cfg.xml looks as following:-
My SessionFactory configuration file looks as follows:
<session-factory>

<property name="hibernate.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>


</session-factory>




Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
[12/12/06 10:38:43:191 GMT] 0000003f 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: lookupExt
Context name: HCLDSGMTP057Node01Cell/nodes/HCLDSGMTP057Node01/servers/server1
Target name: java:comp/UserTransaction
Other data: ""
Exception stack trace: javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: java
at com.ibm.ws.naming.jndicos.CNContextImpl.checkForUrlContext(CNContextImpl.java:3114)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1407)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1290)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:83)
at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:159)
at org.hibernate.impl.SessionImpl.checkTransactionSynchStatus(SessionImpl.java:1861)
at org.hibernate.impl.SessionImpl.isOpen(SessionImpl.java:320)
at com.dixons.persistence.framework.server.HibernateSession.close(HibernateSession.java:158)
at com.dixons.persistence.framework.server.HibernateSession.finalize(HibernateSession.java:185)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java(Compiled Code))
at java.lang.ref.Finalizer.access$100(Finalizer.java(Inlined Compiled Code))
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java(Compiled Code))


Any help would be greatly appreciated, thanks in advance.
Regards
shikhar rastogi

_________________
shikhar


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 5:34 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
Try to add jta.UserTransaction property into your hibernate.cfg.xml file, like this:

<property name="jta.UserTransaction">
java:comp/UserTransaction
</property >

_________________
Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 12:33 am 
Newbie

Joined: Mon Dec 18, 2006 12:43 pm
Posts: 3
I have already done this but the response is the same.

_________________
shikhar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 4:20 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
Did you use Bean-Managed Transaction or Container-Managed Transaction? What type of container you use - web container or ejb container?

Try to use jta/usertransaction as the value of jta.UserTransaction property to your Hibernate.cfg.xml file, like this:

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

_________________
Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 7:14 am 
Newbie

Joined: Mon Dec 18, 2006 12:43 pm
Posts: 3
I'm using bean managed transaction and everything is runing inside the webcontainer only.....and below are the some of properties of my hibernate.cfg.xml


Code:
<session-factory>
        <property name='hibernate.interceptor'>com.dixons.branch.framework.server.AuditInterceptor</property>

<property name="connection.datasource">java:comp/jdbc/eclipse</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property> <property "transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>             <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">jta.usertransaction</property>
<property name="hibernate.session_factory_name">com.dixons.persistence.framework.server.HibernateSessionFactory</property>
      <!-- Cache manager -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.transaction.auto_close_session">true</property>
      <property name="show_sql">true</property>


warm regards,

shikhar

_________________
shikhar


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 21, 2006 5:36 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
shikhar, as i understand, this isn't new problem. Look at this issue in Hibernate JIRA: http://opensource.atlassian.com/projects/hibernate/browse/HHH-198?page=comments#action_25691

and also to the post in this forum:

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

_________________
Best Regards


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