-->
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.  [ 3 posts ] 
Author Message
 Post subject: Proxies remain in cache after bulk delete?
PostPosted: Thu May 19, 2005 12:49 am 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
Hibernate 3.0.3

I noticed that when I do a bulk delete I have to execute
Code:
Session.flush();
Session.clear();

or else the lazy-loading proxies remain in memory and when I invoke Session.get(Class Clazz, Serializable id) later on it returns a proxy that points to a nonexistant row.

Is this a bug?

The reference documentation doesn't seem to discuss what happens to proxies after a bulk delete. In the example they give, they close the transaction right after the update operation so obviously they don't run into the same problem as me. I'm trying to execute queries immediately after a bulk delete without closing the transaction or session like is done in the example.

Ideas?

Gili


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 7:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The session caches are not at all managed in response to bulk operations.

Think about the impossibility of this.

The documentation does discuss this this. http://www.hibernate.org/hib_docs/v3/reference/en/html/batch.html#batch-direct

The very first paragraph; proxies are the entity's in-memory state...


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 7:48 pm 
Senior
Senior

Joined: Tue Mar 02, 2004 6:17 pm
Posts: 151
steve wrote:
The session caches are not at all managed in response to bulk operations.

Think about the impossibility of this.

The documentation does discuss this this. http://www.hibernate.org/hib_docs/v3/reference/en/html/batch.html#batch-direct

The very first paragraph; proxies are the entity's in-memory state...


This turned out to be caused by a bug in my code and not related to the Session cache. Thanks anyway.

Gili


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