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

ManagedConnectionPool doesn't work in a transactional context

    XMLWordPrintable

    Details

      Description

      From the reporter:

      "Anyways, what seems to be the real problem is that all the things that need to be persisted are saved in memory and then when the transaction is completing (either in prepare or commit phase) the loader attempts to get a connection from the datasource. Apparently this is illegal and throws an exception which is what causes the HeuristicMixedException further up the chain.

      This only fails when using a ManagedConnectionFactory. If I swap out a PooledConnectionFactory it works fine. I presume the managed version fails because it returns the same connection that is part of the active transaction for that thread and you can't perform new operations on that connection once the transaction is already in prepare or commit. This feels like a bit of a design flaw to me... I didn't see an obvious fix."

      This possibly has to do with the AbstractCacheStore doing the following in prepare():

      "
      public void prepare(List<? extends Modification> mods, GlobalTransaction tx, boolean isOnePhase) throws CacheLoaderException {
      if (isOnePhase)

      { applyModifications(mods); }

      else

      { transactions.put(tx, mods); }

      }
      "

      and later during commit actually writing the changes to the store. This generic, "abstract" behaviour is intended for non-transactional data stores (such as a filesystem). Behaviour should be different when it comes to transactional data stores.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mircea.markus Mircea Markus (Inactive)
              Reporter:
              manik Manik Surtani (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: