delete ALL tables

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

delete ALL tables

Sebaso
Hi All,


I'm using CLEAN_INSERT but it doesn't delete ALL the tables... and the worst part is that it fails to clean some tables that have dependencies... so for example I had one test that created circular dependencies and didn't clean up the tables after the test. That made fail 50% of the tests... al the tests executed after it...

is there any way to delete ALL tables after (or before) each test ?

It would be fine even if I could restart the in memory derby db ! (that would recreate the whole schema from scratch)

thanks guys !


--
Sebastian E. Ovide





------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense..
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: delete ALL tables

Jakob Keres-2
Hi,

I'm afraid I have the same problem, although I'm using in-memory
hibernate. I tried to add a DELETE_ALL operation before, but this
doesn't change anything. I thought it could be a problem of foreign
keys, but the table order in my XML file should be right (the same
order as for creation). Unfortunately the log doesn't show anything
relevant. Is there any possibility to find the reason for this
behavior? But also a complete clean or restart or whatever would be
fine.

Help would be very appreciated.
Jakob

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense..
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: delete ALL tables

Jakob Keres-2
2011/6/24 Jakob Keres <[hidden email]>:
> Hi,
>
> I'm afraid I have the same problem, although I'm using in-memory
> hibernate.

hsqldb I meant, of course...

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense..
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: delete ALL tables

Jenny, Albert
In reply to this post by Sebaso

I have backed away from full DB exports.  But even one-table-at-a-time, I have had problems with CLEAN_INSERT when using InsertIdentityOperation.  Sometimes it works, sometimes it doesn’t.  I am now using the approach below and it appears to work with seven tables that range in size from 33 to 11000 rows.   (This is part of a Spring/Junit approach.)

 

IDatabaseConnection     dbConn;

String                  dbStatePath;

IDataSet                dataSet;

 

@Before

public void setUp() throws Exception {

            dbConn      = new DatabaseDataSourceConnection(dataSource);

            dbStatePath = new String("C:\\DBstates\\DBstateOSH\\");

           

            setUpDataset("PM_COMPANY");

            setUpDataset("PM_PERSON");

            setUpDataset("CLASSIFIER");

            setUpDataset("CLASS_TEXTE_X");

            setUpDataset("TEXTE");

            setUpDataset("TEXTE_REVISION");

            setUpDataset("TRANSLATION");

}

 

private void setUpDataset(String tName) throws Exception {

            dataSet = new FlatXmlDataSetBuilder().build(new File(dbStatePath+tName+".xml"));

            InsertIdentityOperation.TRUNCATE_TABLE.execute(dbConn, dataSet);

            InsertIdentityOperation.INSERT.execute(dbConn, dataSet);

}

 

Al Jenny

 

From: Sebastian E. Ovide [mailto:[hidden email]]
Sent: Friday, June 24, 2011 2:30 AM
To: [hidden email]
Subject: [dbunit-user] delete ALL tables

 

Hi All,


I'm using CLEAN_INSERT but it doesn't delete ALL the tables... and the worst part is that it fails to clean some tables that have dependencies... so for example I had one test that created circular dependencies and didn't clean up the tables after the test. That made fail 50% of the tests... al the tests executed after it...

is there any way to delete ALL tables after (or before) each test ?

It would be fine even if I could restart the in memory derby db ! (that would recreate the whole schema from scratch)

thanks guys !


--
Sebastian E. Ovide




------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense..
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user