Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11563

Race condition in PersistenceUnitServiceImpl when the service is being stopped

    XMLWordPrintable

Details

    Description

      There's a race in the PersistenceUnitServiceImpl.stop() as the service is stopped in a thread. The entityManagerFactory is a volatile variable not read into a local variable and may be set to null if stop is invoked twice. The proxyBeanManager should be looked as well.

      16:38:59,190 ERROR [org.jboss.as.jpa] (ServerService Thread Pool -- 26) WFLYJPA0007: Failed to stop persistence unit service jpa_classTransformerTestWithMockProvider.ear/ejbjar.jar#mypc: java.lang.NullPointerException
      	at com.sun.proxy.$Proxy101.isOpen(Unknown Source)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2$1.run(PersistenceUnitServiceImpl.java:255)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2$1.run(PersistenceUnitServiceImpl.java:236)
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:649)
      	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2.run(PersistenceUnitServiceImpl.java:281)
      	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
      	at java.lang.Thread.run(Thread.java:748)
      	at org.jboss.threads.JBossThread.run(JBossThread.java:485)
      

      Attachments

        Activity

          People

            smarlow1@redhat.com Scott Marlow
            jperkins-rhn James Perkins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: