-->
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: Session management
PostPosted: Thu Oct 07, 2004 10:22 am 
Regular
Regular

Joined: Tue Jan 27, 2004 12:22 pm
Posts: 103
Hello,

I still don't really understand how to manage the session. That's why I hope somebody will make it clear using a example I thought off, here goes:

User opens a persisted order which is passed to the UI layer (open a session, retrieve order, close session and pass it to UI layer).
Order contains a object address which needs to be replaced by another address. User clicks in UI on change address and a addresspanel pops up. Address panel reads all addresses from database, but because it are more than 2000 adresses they are paged per 100. (Business logic opens new session to retrieve addresses, passes a page with objects to UI layer and leaves session open for another page (?) Session is closed when new selected adres is returned). User decides to create three orders,order1 and order3 have same adress, but are from different sessions.
User saves the order entries. (new Session is created and instances are saveupdated()).

Can somebody please tell me if this is the correct method of handling with sessions. Now is use a single session for all this, but that is an anti-pattern. The two biggest problems I have are:
* pageing the result leaves session open and could result in timeout on sql connection
* saving the three orders with two addresses with the same identifier and which are different objects (two sessions) results in an exception.

Thank you very much for helping.

_________________
Dencel
- The sun has never seen a shadow -


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.