Does JCache
support EJB Transaction
while cache read/write?
I want to clear cache entries that added during a transactional method call, if its transaction is rolled back.
I am using Redis
as cache provider and Redisson
's JCache
implementation as client.
No. Support for JTA (Java Transaction API supported by EJBs), was initially planed in the JCache spec but was removed before the release of version 1.0
As for the last version of the spec, 1.1.1 (available here) this hasn't changed.
Redisson on the other hand does provide a XAResource
that can be enlisted in JTA transactions, using an specific API, as JCache doesn't provide it.
You can read more about it in this article