I am experiencing a problem trying to update an object that contains a large collection of Doubles:
Code:
@Entity
public class Container {
@CollectionOfElements(fetch = FetchType.LAZY)
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Cascade(value = CascadeType.EVICT)
private List<Double> elements;
}
When I initially save this object with the elements collection initialized, the save operation takes a short amount of time.
However, if I perform the following steps, the save is very slow:
1. Create a Container object with elements uninitialized and save. (Fast)
2. Load the Container object via the session.load() method.
3. Initialize the elements collection and save the Container object. (Very slow)
I have caching turned on. Also, bulk update is turned on and set to 25, but this is much slower than the first case.
Is there a way to get the performance as in the first case for the second case? Is the update interacting with the cache in a way that is causing this problem?
Thanks,
Anthony