Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » few questions on RepeatableWriteUnitOfWork / IsolatedCache(we have an old application relying more on eclispe link 2.7 without JPA)
few questions on RepeatableWriteUnitOfWork / IsolatedCache [message #1863387] Tue, 30 January 2024 21:46 Go to next message
Marc Godin is currently offline Marc GodinFriend
Messages: 2
Registered: January 2024
Junior Member
Hello ,
I'm currently looking at an old monolith based on eclipse link 2.7 but not a JPA monolith where we enable L2 by default.
But I'm not sure that in our case, where we have large batches, sharing the L2 cache is the best approach in our default cache for memory reason.
So I have 2 ideas
- the Isolated /Cachepolicy annotation to customize isolation on a "part" of the application seems to be a way forward for not propagation to L2

but also the RepeatableWriteUnitOfWork which seems to provide the "ability" to fill/clear the cache on an L1 session, whereas the standard unit of work doesn't seem to be able to do this, as writechanges is only marked by a single call.
As for RepeatableUnitOfWorkImpl, this class only seems to be available in the context of the JPA entity manager.
So another question is that if I understand Repeatable unitofwork logic correctly (like Hibernate's batch logic) is there a way to do this in the std eclispe link or do I need to migrate to JPA?

I hope I'm not saying too much suptidy, feel free to comment
regards marc

[Updated on: Thu, 01 February 2024 13:34]

Report message to a moderator

Re: few questions on RepeatableWriteUnitOfWork / IsolatedCache [message #1863581 is a reply to message #1863387] Tue, 13 February 2024 13:33 Go to previous message
Marc Godin is currently offline Marc GodinFriend
Messages: 2
Registered: January 2024
Junior Member
Replying to me if it can help other after few investigations


--> isolation via an Annotation seems to be a global setting if one class is marked isolated all the project is isolated and and one isolatedClientsession is provided
that lead to no 2nd level cache here per default you need more to enable promotion to second level cache you need also an customizer descriptor that change the "default pocily" of promotion between L1/L2 via a Customiser on the decriptor
descriptor.getCachePolicy().setUnitOfWorkCacheIsolationLevel(CachePolicy.ISOLATE_NEW_DATA_AFTER_TRANSACTION);
but seems not a good approach as it will copy 2 time clone to get promoted if i'am correct

Another option can be to ask an exclusive connection but don't like it

SO the way to go to read/clear the cache for batch seems the RepetableUnitofwork iit s available at the historical api level at the session level
if you'are using the JPA you have it for free
regards marc






I hope I'm not saying too much suptidy, feel free to comment
regards marc
Previous Topic:Using a @Converter on (nullable) foreign key fields
Next Topic:UCP connection labelling callback in eclipse link jpa
Goto Forum:
  


Current Time: Sun Apr 28 10:20:47 GMT 2024

Powered by FUDForum. Page generated in 0.02685 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top