tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <ja...@laskowski.net.pl>
Subject Re: Nuking tables on tearDown() for CRUD tests
Date Sun, 06 Jan 2008 23:44:34 GMT
On Jan 6, 2008 11:42 PM, Alexander Saint Croix
<saintx.opensource@gmail.com> wrote:

> Dain mentioned that I might completely drop and restart OpenEJB between
> tests.  He also mentioned that OpenJPA might have a way to wipe the database
> tables clean for a given persistence unit.

Here's one possible solution for you - the usage of in-memory db and
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction='add,deleteTableContents')" />. Until
an em is in use the tables are there in db. Once it's closed, at
openejb shutdown, the tables will get dropped automatically. You may
also want to remove the target directory where the db sits in.

See http://www.jaceklaskowski.pl/wiki/Zasady_zapisu_zmian_do_bazy_danych_w_JPA#Konfiguracja_JPA_-_persistence.xml
for some configuration settings. The article is about how entity
changes are persisted in db using different jpa providers and is
written in Polish, but the configuration files should be
well-understandable by non-Polish speakers too.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Mime
View raw message