-->
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: Web environment - managing session patterns? Which one?
PostPosted: Wed Jun 29, 2005 9:22 pm 
Newbie

Joined: Fri Jun 24, 2005 3:32 pm
Posts: 11
So far, my work with hibernate has been in standard java programs. I'm now moving my domain model to the web after testing, but I'm getting confused when reading about the proper "patterns" in using sessions in this environment.

So far, it seems that my best option, would be to start a session at the beginning of my servlet, do the work, and end the session. However, my application will be using "application transactions" stated in the page:

http://www.hibernate.org/168.html

For example, a user will load an object into a web page, wait 5 minutes, then click "save" (or 1 minute, or 10 minutes). That would require me to load the detached object back in.

However, what would happen to my session if a user just closes the web page? I would need a way to close this session, rather than it just hang. What if multiple users just close the web page in the middle of this "application transaction"?

Can someone give me some "blueprints" / best-patterns with something like this?

I plan on using the hibernate deployer in JBoss to deploy my application, and just load the sessions from JNDI in my servlets for now. But this will be my first time using JBoss / Hibernate, and am curious on other programmer's experience/advice.

Thanks!!
--Neelixx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 29, 2005 9:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
HIA chapter 8 talks about these options. The is also various approaches in the wiki patterns section as well.


Top
 Profile  
 
 Post subject: Re: Web environment - managing session patterns? Which one?
PostPosted: Thu Jun 30, 2005 8:11 am 
Newbie

Joined: Fri Jun 24, 2005 3:32 pm
Posts: 11
Neelixx wrote:

However, what would happen to my session if a user just closes the web page? I would need a way to close this session, rather than it just hang.


Okay. I've got HIA and have read the Wiki page, but I didn't see any answers to this. I'll look again.


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.