-->
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: WAS 6 - Hib 3.2 CR4
PostPosted: Tue Oct 10, 2006 3:44 am 
Newbie

Joined: Tue Jul 04, 2006 3:42 am
Posts: 9
Dear all,

I will be re-entered this issue, but i need help. In some previous topics some solutions to the "UnsupportedOperationException" in "get/set?Status" method of WebsphereExtendedJTATransactionLookup have been provided. However, i really couldnt understand and realize those solutions.

One solution was to add a configuration parameter about WebSphere Portal. The question is to have a JNDI name as given in that solution, what should i do? I have Websphere Network Deployment distribution. DOes it already have a portal server on it, do i have to download/buy it? Any other WAS solutions to such a JNDI name?

Second solution, was talking about negatively enhancing "something". Can anybody elaborate on it, with help of attaching some source?

I am using WAS 6.1 and Hib 3.2 CR4. Configuration of hibernate gives the datasource, wants hibernate to work on JTA mode using WebsphereExtendedJTATransactionLookup.

Thanks in advace,

and forgive me duplicating such an entry.

Siyamed


Top
 Profile  
 
 Post subject: Extension
PostPosted: Wed Oct 11, 2006 3:17 am 
Newbie

Joined: Tue Jul 04, 2006 3:42 am
Posts: 9
Hi,

Maybe i need to provide more info on this issue, and the error i am getting. Unfortunately technically i cannot copy&paste the stack trace; so i will try to write some of them.

It seems that somehow (probably from a path that shouldnt have been executed) the getStatus function of TransactionMangerAdapter in .WebSphereExtendedJTATransactionLookup is called; i concluded so because that operation immediately throws this exception.

The error is something like below:

Caused by org.hibernate.TransactionEx: could not register syncronization with JTA TransactionManager
at org.hib.jdbc.JDBCContext.registersynchronizationIfPossible
at org.hib.impl.SEssionImpl.checkTransactionSynchStatus
....

Caused by: java.lang.UnsupportedOp.Exc.
at org.hib.transaction.WebSphereExtendedJTATransactionLookup $ TransactionManagerAdapter.getStatus(WebSphereExtendedJTATransactionLookup:78)
at org.hib.transaction.JTATransactionFActory.isTransactionInProgress()
at org.hib.jdbc.JDBCContext.isTransactionInProgress
at org.hib.jdbc.JDBCContext.registerSynchronizationIfPossible
at org.hib.impl.SEssionImpl.checkTransactionSynchStatus


Thanks in advance,

Siyamed


Top
 Profile  
 
 Post subject: WebSphereExtendedJTATransactionLookup in Hibernate 3.2
PostPosted: Mon Oct 16, 2006 8:59 pm 
Newbie

Joined: Mon Oct 16, 2006 8:47 pm
Posts: 2
With Hibernate 3.1.3, I was able to configure the following:

hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
jta.UserTransaction=java:comp/UserTransaction
hibernate.current_session_context_class=jta

and successfully use JTA contextual sessions in session beans and the web tier of WebSphere 6.0.2.

Simply replacing the Hibernate 3.1.3 jar with the Hibernate 3.2 jar results in the error reported above (UnsupportedOperationException in getStatus()).

I compared the source code between the versions and found that the codepath for determining if a JTA transaction is in progress has changed. The bottom line is that the new JTATransactionFactory.isTransactionInProgress method will always call getStatus on the looked up TransactionManager if it exists and no UserTransaction has yet been bound. This call is always a no-op in WebSphereExtendedJTATransactionLookup.

I am not familiar enough with inner workings of Hibernate to say for sure that my fix has no problems, but I changed line 93 of that class to:

if ( jdbcContext.getFactory().getTransactionManager() != null && jdbcContext.getFactory().getTransactionManager() instanceof WebSphereExtendedJTATransactionLookup.TransactionManagerAdapter == false) {

This just skips the TransactionManager check if using that lookup class and works fine with my web tier DAO layer.

It seems to me that CMT with WebSphereExtendedJTATransactionLookup will always fail since there is no UserTransaction to fall back on and the getStatus will always fail.

I would appreciate if someone could verify my thinking or suggest a better alternative.

Thanks,

Tim


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.