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

Check TX support for remote caches

    Details

      Description

      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);
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  pruivo Pedro Ruivo
                  Reporter:
                  pruivo Pedro Ruivo
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: