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.

Environment

None

Activity

Show:
Vlad Mihalcea
July 5, 2018, 7:23 PM

Switching to JCache does not work either.

Consider we have the following properties:

I now get:

Steve Ebersole
July 11, 2018, 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).

Steve Ebersole
July 11, 2018, 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

Henri Tremblay
July 11, 2018, 4:42 PM

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

For Ehcache 2, I don't know.

Ludovic Orban
July 11, 2018, 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).

Assignee

Vlad Mihalcea

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.17

Components

Affects versions

Priority

Major
Configure