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?
|
|