Re: Perform automatic drop and create db schema

2007-01-31 Thread Dain Sundstrom
: Perform automatic drop and create db schema Automatically clean that data without dropping the tables makes even more sense. That would be a really cool feature. Deciding that two is a quorum, and needing something to do on my flight to Salt Lake City, I implemented a new SchemaTool action

RE: Perform automatic drop and create db schema

2007-01-31 Thread Patrick Linskey
immediately return this by email and then delete it. -Original Message- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 12:22 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Perform automatic drop and create db schema What version of OpenJPA

Re: Perform automatic drop and create db schema

2007-01-02 Thread Marc Prud'hommeaux
Shay- Unfortunately, we don't have any automatic drop-table feature, but I agree it would be handy (you might want to make a JIRA report with the suggestion). The only other recourse, I think, would be to just manually delete the database files before running your tests. On Jan 2,

Re: Perform automatic drop and create db schema

2007-01-02 Thread Marc Prud'hommeaux
Robert- I completely agree. We usually just build all the tables once and then just try to make sure all the objects are deleted at the end of the test, but you are correct that this is sometimes more cumbersome than it could be. An easy drop-then-create option would simplify this,

Re: Perform automatic drop and create db schema

2007-01-02 Thread Craig L Russell
For What It's Worth: +1 on the drop-tables feature for OpenJPA. But I would caution against using it on each test. Sadly, my experience is that drop-create-tables is 99.9% of the time taken in a typical test. The JDO TCK runs hundreds of tests and we drop-create tables only on demand.

Re: Perform automatic drop and create db schema

2007-01-02 Thread Abe White
Unfortunately, we don't have any automatic drop-table feature, but I agree it would be handy (you might want to make a JIRA report with the suggestion). Note that the SynchronizeMappings property allows you to use all the arguments of the mappingtool. So you can try something like:

Re: Perform automatic drop and create db schema

2007-01-02 Thread Marc Prud'hommeaux
Personally, I like to put both the data cleanup and data initialization in the setUp() stage. It's sometimes a bit slower, but if there is faulty cleanup logic in a previous test's tearDown(), it may affect some random test down the road, and it can sometimes be very difficult to track

Re: Perform automatic drop and create db schema

2007-01-02 Thread robert burrell donkin
On 1/2/07, Marc Prud'hommeaux [EMAIL PROTECTED] wrote: Personally, I like to put both the data cleanup and data initialization in the setUp() stage. It's sometimes a bit slower, but if there is faulty cleanup logic in a previous test's tearDown(), it may affect some random test down the road,

Re: Perform automatic drop and create db schema

2007-01-02 Thread robert burrell donkin
On 1/2/07, Craig L Russell [EMAIL PROTECTED] wrote: For What It's Worth: +1 on the drop-tables feature for OpenJPA. But I would caution against using it on each test. Sadly, my experience is that drop-create-tables is 99.9% of the time taken in a typical test. The JDO TCK runs hundreds of

Re: Perform automatic drop and create db schema

2007-01-02 Thread Shay Banon
It is one of the first things I tried, I got this exception: Caused by: org.apache.openjpa.lib.util.ParseException: There was an error while setting up the configuration plugin option SynchronizeMappings. The plugin was of type org.apache.openjpa.jdbc.meta.MappingTool. Setter methods for the

Re: Perform automatic drop and create db schema

2007-01-02 Thread Abe White
Caused by: org.apache.openjpa.lib.util.ParseException: There was an error while setting up the configuration plugin option SynchronizeMappings. The plugin was of type org.apache.openjpa.jdbc.meta.MappingTool. Setter methods for the following plugin properties were not available in that

Re: Perform automatic drop and create db schema

2007-01-02 Thread Shay Banon
The way I usually do things is by starting a transaction, and simply rolling it back when my test finishes (if it wasn't committed/rolled back during the test method). This usually supports 90% of an application integration tests needs. In my case, I have simple tests, I am running them against

Re: Perform automatic drop and create db schema

2007-01-02 Thread Abe White
Just using refresh does not clean up the data in the database (getting Unique constraints violations). Just for kicks I tried SchemaTool.DropTables=true, it did pass the configuration phase, but it still did not cleaned the data/schema. None of the options I mentioned are meant to clean up

RE: Perform automatic drop and create db schema

2007-01-02 Thread Shay Banon
are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -Original Message- From: Abe White Sent: Tuesday, January 02, 2007 2:04 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Perform automatic drop

RE: Perform automatic drop and create db schema

2007-01-02 Thread Shay Banon
Subject: Re: Perform automatic drop and create db schema On 1/2/07, Craig L Russell [EMAIL PROTECTED] wrote: For What It's Worth: +1 on the drop-tables feature for OpenJPA. But I would caution against using it on each test. Sadly, my experience is that drop-create-tables is 99.9

RE: Perform automatic drop and create db schema

2007-01-02 Thread Patrick Linskey
-Original Message- From: Shay Banon [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 02, 2007 2:33 PM To: open-jpa-dev@incubator.apache.org Subject: RE: Perform automatic drop and create db schema Automatically clean that data without dropping the tables makes even more sense