openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcin Kwapisz" <>
Subject RE: Propblem with OpenEJB + Toplink unit tests
Date Mon, 04 Aug 2008 12:45:17 GMT
> It may be that TopLink doesn't know how to find our
> TransactionManager.  OpenJPA finds it automatically by calling
> org.apache.openejb.OpenEJB.getTransactionManager().  For Hibernate,
> there's the TransactionManagerLookup which can be configured.  Do you
> know if there's anything similar in TopLink?
[Marcin Kwapisz] 
Thanks David for the hint.

There is such feature and similar problem (solution also) is described here:
and here:

The only one thing I had to find was TransactionManager jndi name: java:comp/TransactionManager

public class OpenEJBTransactionController extends JTATransactionController

    public static final String JNDI_TRANSACTION_MANAGER_NAME = "java:comp/TransactionManager";
    public OpenEJBTransactionController()
    protected TransactionManager acquireTransactionManager() throws Exception
        return (TransactionManager) jndiLookup(JNDI_TRANSACTION_MANAGER_NAME);

and in persistence.xml

<property name="" value="pl.zsk.samples.ejbservice.OpenEJBTransactionController"/>

Marcin Kwapisz
Division of Computer Networks
Technical Univeristy of Lodz, Poland

View raw message