-->
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: WebSphere 6 and WebSphereExtendedJTATransactionLookup
PostPosted: Wed Jan 04, 2006 8:52 pm 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Hibernate 3.0.5
WebSphere 6

Hi,
We are trying to make use of CMT through a datasource and for the same have the correct properties set.

<property name="show_sql">true</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>

I can see that the sql query is getting printed but as soon it is trying to commit or synchronize it results in error.

The Exception it throws is
-----------------------------------------
Caused by: java.lang.ClassCastException: org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:37)
at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:120)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
---------------------------------------------------
Also the system log confirms that the setting are coorect

--------------------System Log-----------------------------
[1/4/06 17:51:47:517 GMT-06:00] 00000037 Dialect I Using dialect: org.hibernate.dialect.DB2Dialect
[1/4/06 17:51:47:642 GMT-06:00] 00000037 TransactionFa I Transaction strategy: org.hibernate.transaction.JTATransactionFactory
[1/4/06 17:51:47:658 GMT-06:00] 00000037 NamingHelper I JNDI InitialContext properties:{}
[1/4/06 17:51:47:658 GMT-06:00] 00000037 TransactionMa I instantiating TransactionManagerLookup: org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
[1/4/06 17:51:47:673 GMT-06:00] 00000037 TransactionMa I instantiated TransactionManagerLookup
[1/4/06 17:51:47:751 GMT-06:00] 00000037 TransactionMa I instantiating TransactionManagerLookup: org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
[1/4/06 17:51:47:751 GMT-06:00] 00000037 TransactionMa I instantiated TransactionManagerLookup
[1/4/06 17:51:47:751 GMT-06:00] 00000037 SettingsFacto I Automatic flush during beforeCompletion(): enabled
[1/4/06 17:51:47:751 GMT-06:00] 00000037 SettingsFacto I Automatic session close at end of transaction: enabled
[1/4/06 17:51:47:876 GMT-06:00] 00000037 SettingsFacto I Scrollable result sets: enabled
[1/4/06 17:51:47:876 GMT-06:00] 00000037 SettingsFacto I JDBC3 getGeneratedKeys(): disabled
[1/4/06 17:51:47:876 GMT-06:00] 00000037 SettingsFacto I Connection release mode: null
[1/4/06 17:51:47:892 GMT-06:00] 00000037 SettingsFacto I Default batch fetch size: 1
------------------------------------------------------------------

Where i might be going wrong or some seeting is not set or this is a problem with the Websphere 6?
Any help guys.

Thanks
Vijay


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 9:01 pm 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Also all the code related to Hibernate is running within the remote stateless session bean and i am making use of the sessionFactory.getCurrentSession to obtain Hibernate Session.

Thanks
Vijay


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 9:33 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:20 am
Posts: 40
Location: Vienna
Hi,

the only thing that I see in your code is that you should use
Code:
<property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>


with CMT. Maybe this helps...

regards
Stefan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 8:04 pm 
Beginner
Beginner

Joined: Sat Nov 22, 2003 3:54 pm
Posts: 42
Thanks stefanm, it worked !!!


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.