Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Inserts and Caching

Thanks for the follow-up.


James Sutherland wrote:
> 
> Are you concerned with caching across transaction or within the same
> transaction?
> 

It is the caching within the same transaction. Let's say in one transaction
I have to persist 5000 objects which I do not need afterwards. They should
not unnecessary remain in memory. When a couple of requests are running,
then the memory is filled up pretty quickly.

Does the @Cache NONE actually helps? I wasn't able to find out if the object
was cached.


James Sutherland wrote:
> 
> Across transaction you can disable caching using the persistence.xml
> property,
> "eclipselink.cache.shared.default"="false".  Or you can set the size or
> type of the cache to control how many objects are cached.
> 

Thanks for the tip. 


James Sutherland wrote:
> 
> For avoiding caching within a single transaction, the best way is to
> flush() then clear() the EntityManager.  You could do this for each
> object, or probably better for each batch of objects.
> 

Ok, but then the transaction is committed and restarted. In case of a
rollback I have "unstable" data since the part before the flush wasn't
rolled back.

Thanks
Jan

-- 
View this message in context: http://www.nabble.com/Inserts-and-Caching-tp24109228p24167138.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top