tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jean-louis.monte...@atosorigin.com>
Subject Re: Persistence Unit Property Overrides
Date Sun, 04 Oct 2009 19:57:45 GMT

Hi Quintin,

Yes, you can use InitialContext properties in unit tests to override
properties.
Just one tip, you must use the persistence unit name and not the datasource
name.

Have a look to
http://openejb.apache.org/3.0/configuring-persistenceunits-in-tests.html

Hope it helps.
Jean-Louis


Q Beukes wrote:
> 
> Hey,
> 
> In my persistence unit I have properties to customize the behaviour of
> the JPA implementation, ie. hibernate.
> 
> Is there a way to override these properties programmatically?
> 
> I am thinking specifically of unit tests, where I want hibernate to
> "drop-create" instead of just "create". I tried specifying it in my
> datasource creation properties in the InitialContext environment
> hashtable, but this doesn't seem to take "priority", and looks like it
> is applied last. Or did I make a mistake somewhere?
> 
> Thanks,
> Quintin Beukes
> 
> 

-- 
View this message in context: http://www.nabble.com/Persistence-Unit-Property-Overrides-tp25725276p25741554.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message