-->
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.  [ 8 posts ] 
Author Message
 Post subject: implementation of session-per-conversation
PostPosted: Mon Nov 21, 2005 8:30 pm 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
I want to implement the pattern session-per-conversation described in this link: http://www.hibernate.org/42.html#A4
As you can see in the image,
Image
the flush is executed only in the last transaction.
How can I implement this?
How can I finished the transaction T1? Should I execute t1.rollback()?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 8:39 am 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
Nobody has implemented this pattern?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 8:46 am 
Beginner
Beginner

Joined: Fri Nov 19, 2004 11:38 am
Posts: 29
Take a loook at this link:
http://www.hibernate.org/43.html#A5

Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 9:03 am 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
Thank you for attention.
I've already looked this page, but my doubt persists.
I'm working in a swing application.
My main doubt is:

How can I finish the transaction T1? Should I execute t1.rollback()?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 9:06 am 
Beginner
Beginner

Joined: Fri Nov 19, 2004 11:38 am
Posts: 29
What about closing it and removing it from the (http) session ?
The filter will open a new one if it finds nothing in the http session.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 10:03 am 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
Close transaction? The hibernate team tell to demarcate explicitly the transactions. So, probably there are only two options: commit or rollback the transaction.
I haven't http session or filters, because I'm working in a swing application without J2EE server.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 3:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
don't understand your question/concern here.

just commit t1.

the assumption is that, because you use FlushMode.NEVER, Hibernate does not write anything to the database during that first transaction. Of course, that also assumes you don't explicitly call session.flush() yourself during t1.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 4:25 pm 
Regular
Regular

Joined: Thu Apr 14, 2005 2:15 pm
Posts: 66
Ok, this resolved the problem.
There was a bug in the code, that has setted the FlushMode to AUTO after I set to NEVER.


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