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: Performance of getCurrentSession patterns
PostPosted: Wed Nov 16, 2005 6:44 pm 
Newbie

Joined: Fri Mar 04, 2005 2:02 pm
Posts: 18
I've checked out the new getCurrentSession functionality and its great. I have a performance question though.

The sessions are bound to transactions, so the following is needed

tx1
getCurrentSession (s1 is returned)
insert object a
tx1.commit

tx2
getCurrentSession (s2 is returned)
load object a
update object a
tx2.commit

tx3
getCurrentSession (s3 is returned)
load object a
update object a
tx3.commit

the 'load object a' entries in tx2 and tx3 bother me. Seems like this is a lot of loading. Also seems that either second level cache is enabled and working or i'll get a database hit on each load...

another way is more session per conversation

s1
tx1
insert object a
tx1.commit

tx2
load object a
update object a
tx2.commit

tx3
update object a
tx3.commit
s1.close

No need to 'reload' here.

What are the performance implications of both. Should I care?


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.