openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: TransactionSynchronizationRegistry reference cached permanently
Date Mon, 18 Aug 2008 15:44:35 GMT
Hi David,

Is it possible to fix this on the TSR implementation side?

Specifically, since TSR implementation is registered with JNDI, could  
you refactor it into a permanent singleton registered in JNDI that  
delegates to the real implementation?

And the server code notify it the JNDI instance when there is a server  
state change that would invalidate the implementation. Then the JNDI  
object could delegate to the new implementation object.

Seems like the only difference between what you're proposing and what  
I'm proposing is the receiver of the change notification.

Craig

On Aug 15, 2008, at 4:10 PM, David Blevins wrote:

> Seems there are some slight differences in the way OpenJPA tracks  
> the TransactionManager reference versus the  
> TransactionSynchronizationRegistry.  The TransactionManager appears  
> to be fetched once per EntityManagerFactory, so if the underlying  
> app server does any sort of rebooting the new TransactionManager  
> instance is picked up just fine as OpenJPA continues to get it from  
> the app server.  This is good.  However when it comes to the  
> TransactionSynchronizationRegistry, it seems OpenJPA grabs it once  
> for the life of the VM and never lets it go.  So if any sort of  
> rebooting happens in the app server OpenJPA will not get the new  
> TransactionSynchronizationRegistry and of course ceases to work  
> properly.	
>
> Is it possible we can get this fixed for the next release?
>
> -David
>
> (pulled these stack traces of the code referencing the old  
> TransactionSynchronizationRegistry, may or may not be useful to you)
>
>  at org.apache.openjpa.ee.RegistryManagedRuntime 
> $ 
> TransactionManagerRegistryFacade 
> .getStatus(RegistryManagedRuntime.java:130)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .AbstractBrokerFactory 
> .syncWithManagedTransaction(AbstractBrokerFactory.java:723)
>  at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java: 
> 320)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java: 
> 216)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java: 
> 190)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
>  at  
> org 
> .apache 
> .openjpa 
> .persistence 
> .EntityManagerFactoryImpl 
> .createEntityManager(EntityManagerFactoryImpl.java:192)
>  at  
> org 
> .apache 
> .openjpa 
> .persistence 
> .EntityManagerFactoryImpl 
> .createEntityManager(EntityManagerFactoryImpl.java:56)
>
>         --
>  at org.apache.openjpa.ee.RegistryManagedRuntime 
> $ 
> TransactionManagerRegistryFacade 
> .getStatus(RegistryManagedRuntime.java:130)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .AbstractBrokerFactory 
> .syncWithManagedTransaction(AbstractBrokerFactory.java:723)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel.BrokerImpl.syncWithManagedTransaction(BrokerImpl.java:1391)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .DelegatingBroker.syncWithManagedTransaction(DelegatingBroker.java: 
> 893)
>  at  
> org 
> .apache 
> .openjpa 
> .persistence 
> .EntityManagerImpl.joinTransaction(EntityManagerImpl.java:501)
>
>         --
>  at org.apache.openjpa.ee.RegistryManagedRuntime 
> $ 
> TransactionManagerRegistryFacade 
> .registerSynchronization(RegistryManagedRuntime.java:118)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .AbstractBrokerFactory 
> .syncWithManagedTransaction(AbstractBrokerFactory.java:735)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel.BrokerImpl.syncWithManagedTransaction(BrokerImpl.java:1391)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .DelegatingBroker.syncWithManagedTransaction(DelegatingBroker.java: 
> 893)
>  at  
> org 
> .apache 
> .openjpa 
> .persistence 
> .EntityManagerImpl.joinTransaction(EntityManagerImpl.java:501)
>
>         --
>  at org.apache.openjpa.ee.RegistryManagedRuntime 
> $ 
> TransactionManagerRegistryFacade 
> .getTransactionKey(RegistryManagedRuntime.java:134)
>  at  
> org 
> .apache 
> .openjpa 
> .ee 
> .RegistryManagedRuntime 
> .getTransactionKey(RegistryManagedRuntime.java:88)
>  at  
> org 
> .apache 
> .openjpa 
> .ee 
> .AutomaticManagedRuntime 
> .getTransactionKey(AutomaticManagedRuntime.java:255)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .AbstractBrokerFactory 
> .syncWithManagedTransaction(AbstractBrokerFactory.java:740)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel.BrokerImpl.syncWithManagedTransaction(BrokerImpl.java:1391)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .DelegatingBroker.syncWithManagedTransaction(DelegatingBroker.java: 
> 893)
>  at  
> org 
> .apache 
> .openjpa 
> .persistence 
> .EntityManagerImpl.joinTransaction(EntityManagerImpl.java:501)
>
>         --
>  at org.apache.openjpa.ee.RegistryManagedRuntime 
> $ 
> TransactionManagerRegistryFacade 
> .registerSynchronization(RegistryManagedRuntime.java:118)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .AbstractBrokerFactory 
> .syncWithManagedTransaction(AbstractBrokerFactory.java:746)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel.BrokerImpl.syncWithManagedTransaction(BrokerImpl.java:1391)
>  at  
> org 
> .apache 
> .openjpa 
> .kernel 
> .DelegatingBroker.syncWithManagedTransaction(DelegatingBroker.java: 
> 893)
>  at  
> org 
> .apache 
> .openjpa 
> .persistence 
> .EntityManagerImpl.joinTransaction(EntityManagerImpl.java:501)
>

Craig L Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message