Hi sbawaska,
Thanks a lot for the above information. I will briefly explain what we are trying to achieve.
We are building an application which consume message from MQ and process it. We are building this application as multiple OSGI bundles. Since we are in development phase Apache karaf is our runtime environment.
We are using com.atomikos.icatch.jta.UserTransactionManager as the transactionManager along with org.springframework.transaction.jta.JtaTransactionManager.
We are initializing the Cache (backed up by database) during the server start up and the same cache instance will be used throughout the application.
We are using Camel jms component for the receiving message from MQ. So once the messaged received in the MQ, camel jms endpoint will start the transaction( since we are associating the jms component with above jta txn manager). During the message processing we will add certain entry in the cache instance which has been created during the server start up. But the data inserted in the cache is getting committed immediatly (not participating in txn). same during the rollback also.
Please find below sudo code for the cache creation. Am I missing some configuration here. do I need to enable Copy-on-read when using the region in txn.
Cache cache = new CacheFactory(properties).create();
cache.<String, Object> createRegionFactory(RegionShortcut.REPLICATE).setCacheWriter(writer1).setCacheLoader(loader1).create(map1);
cache.<String, Object> createRegionFactory(RegionShortcut.REPLICATE).setCacheWriter(writer2).setCacheLoader(loader2).create(map2);
Also please pass me the system property which allows the persisted regions to participate in txn .