-->
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.  [ 4 posts ] 
Author Message
 Post subject: Delete Collection Item - Second Level Cache
PostPosted: Wed Mar 15, 2006 5:04 pm 
Newbie

Joined: Tue Jan 17, 2006 5:21 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate 3.1:

Mapping documents: Annotations
@OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="basket")

@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL, region="shopping")

public Set<BasketItem> getBasketItems() {

return this.basketItems;

}

public void setBasketItems(Set<BasketItem> items) {

this.basketItems = items;

}


Name and version of the database you are using: Oracle 10g

Is it normal behavior that when I delete an item in a collection that has been cached (both the entity and thought the parent) that it removes the entire collecion from cache. The next time I load this data it needs to select all the Items in the collection.

Below is the output from the second level cache when I delete.

DEBUG - org.jboss.cache.TreeCache - _remove(GlobalTransaction:<null>:22, "/scps_cache/shopping/edu.nyu.scps.website.domain.shopping.Basket.basketItems#36")


Is it possible to just remove the ID of the item in the collection relationship?

Thanks,
Josh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 8:14 pm 
Regular
Regular

Joined: Thu May 26, 2005 12:20 am
Posts: 72
what second level cache provider are you using? what do the caching properties look like?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 12:40 pm 
Newbie

Joined: Tue Jan 17, 2006 5:21 pm
Posts: 3
I am using Jboss TreeCache. In this cache you don't specify entity objects in the configuration file, you just configure cache regions.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 1:17 pm 
Regular
Regular

Joined: Thu May 26, 2005 12:20 am
Posts: 72
I am not familiar with TreeCache, but I think that how the eviction happens is a property of the caching tool, not of Hibernate. Maybe post your question on the TreeCache forum or explore other caching tools?


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