Caused by: java.lang.UnsupportedOperationException: Cache provider [org.hibernate.cache.ehcache.internal.EhcacheRegionFactory@3271ec2a] does not support `transactional` access

Description

When having the following entities:

and bootstrapping Hibernate 5.3.2 with `properties.put("hibernate.cache.region.factory_class", "ehcache");` we get the following exception:

This used to work just fine with Hibernate 5.2.

Activity

Show:

Ludovic OrbanJuly 11, 2018 at 4:57 PM

Both Ehcache 2 and 3 do support full blown XA, including crash recovery with all bells and whistles. For Ehcache 2, you should look for transactional mode "xa_strict" (see http://www.ehcache.org/documentation/2.8/apis/transactions.html) while in version 3 you should add a XAStoreConfiguration to your cache config (see http://www.ehcache.org/documentation/3.0/xa.html).

Henri TremblayJuly 11, 2018 at 4:42 PM

I'm a bit far from these things. Ehcache 3 supports XA.

For Ehcache 2, I don't know.

Steve EbersoleJuly 11, 2018 at 3:56 PM

Specifically, it comes down to whether net.sf.ehcache.Ehcache can be associated with JTA transactions. The PR assumes it can. If not, the PR needs major re-work to leverage the new CacheTransactionContext contract for transactional support

Steve EbersoleJuly 11, 2018 at 3:46 PM

JCache (as a spec) does not define support for integrating with transactions - so why/how do you expect JCache to work via transactional access?

For Ehcache, yes previous versions did in fact "support" transactional access - however, I believe this was not really transactional (integrated with JTA). , can you guys confirm this? Regardless, seeing as how it was there before we could certainly add it back (within the normal caveat that neither hibernate-ehcache nor Ehcache 2.0 itself are supported any more).

Vlad MihalceaJuly 5, 2018 at 7:23 PM

Switching to JCache does not work either.

Consider we have the following properties:

I now get:

Fixed

Details

Assignee

Reporter

Worked in

Components

Fix versions

Affects versions

Priority

Created July 5, 2018 at 3:51 PM
Updated July 20, 2018 at 1:41 PM
Resolved July 13, 2018 at 7:06 AM