BTM
  1. BTM
  2. BTM-112

EhCacheXAResourceProducer does not cleanup after last XAResource has been unregistered

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.2
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Hide
      Ludovic Orban added a comment -

      When ehcache's CacheManager shuts down, it calls EhCacheXAResourceProducer.unregisterXAResource() for each cache with the cache's last XAResource.

      Since no more XAResource is registered, unregisterXAResource should close the EhCacheXAResourceProducer but fails to do so, leaving an unusable XAResourceProducer registered in the ResourceRegistrar.

      This can lead to this kind of exception:

      bitronix.tm.recovery.RecoveryException: no XAResource registered, recovery cannot be done on bitronix.tm.resource.ehcache.EhCacheXAResourceProducer@28bb494b
      	at bitronix.tm.resource.ehcache.EhCacheXAResourceProducer.startRecovery(EhCacheXAResourceProducer.java:123)
      	at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:234)
      	at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:204)
      	at bitronix.tm.recovery.Recoverer.run(Recoverer.java:119)
      	at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:48)
      	at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:43)
      
      Show
      Ludovic Orban added a comment - When ehcache's CacheManager shuts down, it calls EhCacheXAResourceProducer.unregisterXAResource() for each cache with the cache's last XAResource. Since no more XAResource is registered, unregisterXAResource should close the EhCacheXAResourceProducer but fails to do so, leaving an unusable XAResourceProducer registered in the ResourceRegistrar. This can lead to this kind of exception: bitronix.tm.recovery.RecoveryException: no XAResource registered, recovery cannot be done on bitronix.tm.resource.ehcache.EhCacheXAResourceProducer@28bb494b at bitronix.tm.resource.ehcache.EhCacheXAResourceProducer.startRecovery(EhCacheXAResourceProducer.java:123) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:234) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:204) at bitronix.tm.recovery.Recoverer.run(Recoverer.java:119) at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:48) at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:43)

        People

        • Assignee:
          Ludovic Orban
          Reporter:
          Ludovic Orban
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: