tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dusausoy <>
Subject Spring integration
Date Thu, 03 Jun 2010 13:44:09 GMT

First of all I'd like to thank you for this nice piece of work !
Although I'm a new user of OpenEJB I already find it great.

But unfortunately I have some troubles using it as test environment.

What I'm trying to achieve is integration with Spring JUnit transactional
test hierachy[1] for my DAO's.
Integration with C5 Test Support more precisely[2].

I've read the documentation on OpenEJB site, downloaded, read and launched
the examples.
I've also search the mailing-list archives and found the thread named
"Help with OpenEJB3 and Spring IoC" by Jon Carrera.  
I'm still facing a few problems though.

- persistence.xml : I have provider-agnostic persistence.xml. It's because
we plan on deploying in Glassfish but I'd like to test with OpenEJB.
With plain-Spring it's not a problem because the
LocalContainerEntityManagerFactoryBean allows for heavy customisations. 
The resulting EntityManager is then inserted into the JpaTemplate.
However the scenario is different with OpenEJB.
How can I inject a Spring-created EntityManager into OpenEJB ? I've seen
into the documentation that the opposite is currently not possible (unless
using a simple workaround) but I've seen nothing related to Spring ->
OpenEJB. Is it possible ?

- transactions : here it's more a misunderstanding of the whole
transaction process. 
If I give Spring the transaction manager, like this :

    <bean name="TransactionManager"

    <bean name="transactionManager"
        <property name="transactionManager" ref="TransactionManager"/>

Will Spring call the @Transactional annotated test methods - that is, all
test methods by default - within a transaction ?
Will Spring be in charge of all transaction-handling (propagating it to
EJB's) or will it still be OpenEJB in charge ?
Is there an specific configuration I need to write ?

I don't know if this is all clear, I hope it is ;).

Thanks in advance and keep up the good work !

Bruno Dusausoy
YP5 Software

Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

View raw message