Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-9397

Check TX support for remote caches

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The RemoteCacheManager.getCache() methods would fail to return a transactional cache if the cache in server isn't transactional. It would throw an exception! NotTransactionalException?

      The user can fallback to the non transaction case, example

      try {
        cache = remoteCacheManager.getCache("some-cache", TransactionMode.NON_XA);
      } catch(NotTransactionalException e) {
        cache = remoteCacheManager.getCache("some-cache", TransactionMode.NONE);
      }
      

      In addition, some helper method can be added to the RemoteCacheManager to avoid dealing with exceptions:

      boolean supportsTransactions(String cacheName);
      

      simple example:

      boolean txCache = remoteCacheManager.supportsTransactions("some-cache");
      remoteCacheManager.getCache("some-cache", txCache ? TransactionMode.NON_XA : TransactionMode.NONE);
      

              pruivo@redhat.com Pedro Ruivo
              pruivo@redhat.com Pedro Ruivo
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: