-->
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.  [ 1 post ] 
Author Message
 Post subject: Is SessionInView bad in JTA scenario? Long transaction times
PostPosted: Fri Oct 10, 2003 5:10 am 
Newbie

Joined: Tue Sep 30, 2003 9:27 am
Posts: 12
Hi,

Trying to get to grips with a "open session in view" approach, and the mixture of that with transactions.

It appears I have to tell Hibernate which transaction strategy I want. For example, if I use Hibernate's local transaction strategy then I have to, in my action, get the transaction from Hibernate's session, do the work, then commit the transaction. Yes? That seems to work for me.

If however I set something like:
Code:
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.WeblogicTransactionManagerLookup


then I am unsure when the transaction begins and ends. From my logs, it seems to end when the session is closed, so I guess it begins when the session is opened? So I don't have to explicitly demarcate the transaction? (ie. I don't have to find usertransaction in JNDI and begin it? When I did, I got an error). It seems to work if I don't begin it myself. Automagically its happening under the hood, which is confusing me - so I don't quite know when to explicilty begin/commit it - if at all....

But this all leads to the next thing - if I use the open session in view, so that the session extends across all actions (and other things such as EJB's as I'm using hte thread local pattern), then the session will only be closed when after the JSP page is generated - which means that I think the JTA transaction will extend that long too - which seems like bad practice...

Any pointers?

Thanks
J


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.