geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Code in Transaction object for JPA?
Date Wed, 10 Jan 2007 06:26:12 GMT
BTW the new TransactionSynchronizationRegistry has a nice place to  
keep transaction related data like this.

-dain

On Jan 9, 2007, at 8:00 PM, David Jencks wrote:

> OK
>
> david jencks
>
> On Jan 9, 2007, at 8:53 PM, Dain Sundstrom wrote:
>
>> In the org.apache.geronimo.transaction.manager.Transaction class  
>> we have the following code:
>>
>>     public Object getEntityManager(String persistenceUnit) {
>>         return entityManagers.get(persistenceUnit);
>>     }
>>
>>     public void setEntityManager(String persistenceUnit, Object  
>> entityManager) {
>>         Object oldEntityManager = entityManagers.put 
>> (persistenceUnit, entityManager);
>>         if (oldEntityManager != null) {
>>             throw new EJBException("EntityManager " +  
>> oldEntityManager + " for persistenceUnit " + persistenceUnit + "  
>> already associated with this transaction " + xid);
>>         }
>>     }
>>
>>
>> It looks like the only user of these methods is the JPA code.   
>> Instead of extending out Transaction code for JPA can we simply,  
>> just put a map in the JPA code?  I'd hate to see our transaction  
>> code bloated as each spec comes out.
>>
>> -dain


Mime
View raw message