Search code examples
transactionsredisjava-ee-6ejb-3.1jedis

Container managed transactions with Jedis/Redis


I am reading about Jedis+Redis and integration into EJB (JEE6). I am really willing to try to make use of a nice key-value store.

I was wondering if there is a way with Jedis to have the Jedis library to participate in a container managed transaction as it is done with JTA+JPA usually.

I would love to see that I can just add my access to Jedis in my stateless session bean which has @TransactionAttribute(TransactionAttributeType.REQUIRED) defined.

Atm my test code uses the transaction functions manually (by calling "Transaction.exec()") but I really do not want to mess with transactions manually really!


Solution

  • The answer to this is rather sad: the Jedis/Redis combination is not meant to work with JTA, instead one would need to write it's own resource adapter (RA). I do evaluate 'Hazelcast' key-value store now, since it provides such an adapter out-of-the-box.

    One thing that bugs me though: redis seems to be in use quite a lot even in the JEE world, does this mean people do not care about transactions then?