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