-->
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.  [ 5 posts ] 
Author Message
 Post subject: make persistent objects transient without closing the sessio
PostPosted: Wed Mar 15, 2006 9:48 am 
Newbie

Joined: Wed Mar 15, 2006 9:38 am
Posts: 3
My problem is, that I don't want the feature automatic update of changed objects. So I have to make the loaded objects transient.
But I also don't want to close the session because it's creation costs too much performance.
So is there a way to separate the objects from the session without closing it or to disable the automatic update for my objects somehow else?
Please let me know.


Top
 Profile  
 
 Post subject: Re: make persistent objects transient without closing the se
PostPosted: Wed Mar 15, 2006 10:00 am 
Regular
Regular

Joined: Wed Mar 08, 2006 2:07 am
Posts: 50
Location: Bangalore
kryschan wrote:
So I have to make the loaded objects transient.
But I also don't want to close the session because it's creation costs too much performance.


Actually creating SessionFactory is more expensive in terms of performance, whereas Session is lightweight and can be created easiely.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 4:38 am 
Newbie

Joined: Wed Mar 15, 2006 9:38 am
Posts: 3
Well, you're right. I have done some measurements (each time there are 10000 objects loaded):

- first time(SessionFactory and Session are created): ~ 7s
- only Session created: ~ 3,3s
- Session created before: ~ 1,5s

The times are only slightly influenced by the database-cache.
So you see the Session creation also takes some time.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 6:51 am 
Newbie

Joined: Wed Mar 15, 2006 9:38 am
Posts: 3
Maybe the difference is caused by the fact, that when the session is still open the objects must not be recreated.
establishing a JDBC connection takes only 50 to 100 ms.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 7:17 am 
Regular
Regular

Joined: Wed Mar 08, 2006 2:07 am
Posts: 50
Location: Bangalore
I think that when the session is open the connection would also remain open. That is why changes in objects can be persisted as changes in object take place (after the object has been associated with a session).


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