-->
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: Garbage collection interaction with Session.saveOrUpdate()
PostPosted: Tue Sep 13, 2005 9:38 pm 
Newbie

Joined: Sat Mar 26, 2005 1:44 am
Posts: 1
Are objects kept in memory when saveOrUpdate() from Session is called or is that using a weak reference to the objects? I couldn't find any pointer (pun intended) in the documentation.

I have a small application uploading test data and I create lists of objects and call saveOrUpdate() on each object.

If I cycle through a list and then create a new list within the same transaction, only the elements from the second list are inserted in the database.

If I size the list large enough to contain all the elements then all objects are inserted.

List l;

l = readDataSet1
for each item in the list
session.saveOrUpdate(obj)

l = readDataSet2
for each item in the list
session.saveOrUpdate(obj)

doesn't work but:

l = readDataSet1 + readDataSet2
for each item in the list
session.saveOrUpdate(obj)

works.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 9:54 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
H puts inserted instances in 2nd level cache, not sure about updated instances. You can stop this by setting hibernate.cache.use_second_level_cache = false , but that has of course has consequences.


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.