-->
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.  [ 2 posts ] 
Author Message
 Post subject: there are problems using a permanent isession?
PostPosted: Thu Dec 18, 2008 9:29 am 
Newbie

Joined: Wed Nov 19, 2008 6:35 am
Posts: 5
hi, i have an application where i need that calling session.Get(id) will always retun the same object istance.
as solution i want to use the same session for all the application life, there are few/none concurrency use of it so i think to wrap it in a threadsafe class that will use a lock for every method call.

do you think that i can have problem with this solution?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 18, 2008 2:44 pm 
Newbie

Joined: Wed Dec 17, 2008 6:35 pm
Posts: 11
Do you want to leave a session open across multiple HTTP requests? When do you commit (the transaction is flushed and closed on commit)? Also, if there are any concurrent users things will get out of sync because everything will be eternally in your L1 cache.

You say you always need the same instance of an object (==). Can you write your own equals operator or just compare the key?


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