tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gegas <>
Subject Re: No Maven2 Best Practices?
Date Fri, 09 May 2008 13:15:50 GMT

David Blevins wrote:
> Heh :)  It's not so stupid as we did put some fancy code for mapping  
> the datasources to your persistence.xml without which you might  
> actually need to have separate persistence.xmls.  But we work hard to  
> adapt things to the environment you setup so these kinds of issues are  
> avoided.  And then of course we went the extra mile to make sure you  
> could setup your entire environment right in your test case, config  
> file free, which is nice icing on the cake.  That also allows you to  
> shut off things like transaction or security processing, which can be  
> nice.  Well, technically you're turning *on* the mock transaction  
> manager and/or security service we provide, but you get the idea :)

You did a very good job :-)

David Blevins wrote:
> The one thing that you really might want a different persistence.xml  
> for is maybe there is some JPA provider specific property you use in  
> production that you don't want enabled in test (or vice versa).  I  
> suspect that'll be a rare case, but it's certainly something to keep  
> an eye out for.

I've found something that's a real case. The unit tests uses OpenEJB and my
production environment is JBoss. The property for TransactionManager is
different for test and production:


hibernate.transaction.manager_lookup_class  =


hibernate.transaction.manager_lookup_class =

Now I really would need the ability to use a seperate persistence.xml for

David Blevins wrote:
> Yea, it's definitely an idea to keep on the radar.  We already do  
> allow you to supplement your testing with a separate set of test ejbs  
> which live in src/test/java and are configured via a src/test/ 
> resources/META-INF/ejb-jar.xml, so we'd probably have to find a  
> different way to have a "test" ejb-jar.xml for the production ejbs in  
> src/main/java.  Maybe something as simple as looking for a test.ejb- 
> jar.xml file which we'd prefer over the ejb-jar.xml for testing  
> purposes.
> If the need comes up, definitely let us know.
> -David

Kind regards, Andreas

View this message in context:
Sent from the OpenEJB User mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message