tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gegas <andreas.lc.eriks...@gmail.com>
Subject Re: No Maven2 Best Practices?
Date Wed, 14 May 2008 06:21:27 GMT



David Blevins wrote:
> 
> 
> That's what I get for not testing it first :)  Forgot a break  
> statement.  Updated code at the bottom of this page:
> http://cwiki.apache.org/OPENEJBx30/hibernate.html
> 
> The technique is that the code first tries to find the OpenEJB  
> TransactionManagerLookup strategy and if it can't find that it goes to  
> the JBoss one.  So in your testing where OpenEJB is present that's the  
> one that will get used.  In production where OpenEJB is not present,  
> the JBoss TransactionManagerLookup will get used.
> 
> You could use some other technique to detect the environment you're  
> in, but the basic idea is that the custom TransactionManagerLookup  
> strategy is what gets used in your persistence.xml so you can support  
> both platforms with the same xml file.
> 
> -David
> 
> 
> 

Thank you David!

I remebered you could also put a hibernate.properties file with your
Hibernate specific properties and put it in your classpath as well. Dunno
why I didn't think of this before...

The production hibernate.properties will reside in: src/main/resources

and the test hibernate.properties in: src/test/resources

Now I'm able to have the OpenEJB transaction manager lookup in the test
environment and the JBoss transaction manager lookup in my production
environment.

You've been a great help David! Tahnks a lot :-)

Kind regards, Andreas
-- 
View this message in context: http://www.nabble.com/No-Maven2-Best-Practices--tp17129308p17224144.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message