InstantDB Project
About InstantDB
Project Mail Lists
Short History
Reporting Bugs
Screen Shots
3rd Party Examples
FAQs

Software
Downloads
Documentation
CVS Repositories
Roadmap
License

About Enhydra.org
Who We Are
News, Articles & Events
Getting Involved
Contact Us

Community
Demos
Contributions
Resources
Case Studies
On The Edge! -NEW-
Commercial Vendors


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: InstantDB: Uninstalling a db or deleting a db.



This is running on Winnt 4.0.
Nope don't see the database shutdown complete message but I think that may
be due to how
JUnit is running the test.

Here is some of the code involved in the test.
So when a test is run setUp() is called which creates the prp file in the
temp directory.
The prp file contains only the entry to the table path.

Then a connection is made to this db.
Then the tables are created by createSampleIdbDataBase()

After this the test is run which retrieves id's and password and verifies
them.
Once the test is finished it closes it's connections then tearDown() is
called.

I can't seem to get teardown to remove all the files in the test.


  private static void createSampleIdbDataBase() throws Exception
   {
      Statement stmt = _con.createStatement();
      stmt.executeUpdate("DROP TABLE USERTABLE");
      stmt.executeUpdate("CREATE TABLE USERTABLE (ID VARCHAR(32) PRIMARY
KEY, PASSWORD VARCHAR(32))");
      stmt.executeUpdate("INSERT INTO USERTABLE VALUES (\"goodId\",
\"goodPassword\")");
      stmt.executeUpdate("INSERT INTO USERTABLE VALUES (\"goodDbId\",
\"goodDbPassword\")");
      stmt.close();
   }

    /**
    *  The JUnit setup method
    *
    *@exception  Exception  rethrown
    */
   public void setUp() throws Exception
   {
      _idbPrpFile = createIdbPrpFile();
      createConnection(URL + _idbPrpFile.getAbsolutePath().replace('\\',
'/'), "Juan", "Valdez");
      createSampleIdbDataBase();

   }


   /**
    *  The teardown method for JUnit
    *
    *@exception  Exception  rethrown
    */
   public void tearDown() throws Exception
   {
      Statement stmt = _con.createStatement();
      stmt.executeUpdate("DROP TABLE USERTABLE");
      stmt.close();
      _con.close();
      _con = null;

 	// here is where my file util will try to delete all the files in
the temp directory I created.
   
  	assert("Couldn't clean up test db files",
_fileUtil.deleteAll(_idbPrpFile.getParentFile()));
   }


// create the connection to the instantdb given in the url.	
   private static void createConnection(String url, String user, String
password)
          throws Exception
   {
      Class.forName(DRIVERNAME);
      _con = DriverManager.getConnection(url, user, password);

   }


-----Original Message-----
From: Peter Hearty [mailto:peter.hearty@lutris.com]
Sent: Tuesday, February 27, 2001 11:36 AM
To: instantDB@enhydra.org
Subject: Re: InstantDB: Uninstalling a db or deleting a db.


Dan

I think I've heard of this problem once before, but I don't think I 
ever got to the source of the problem. Couple of questions.

1. Do you see the "Database shutdown complete" message on stdout.
2. What OS are you using?

Pete

----- Original Message -----
From: Dan Mercier <dmercier@mpowertech.com>
Date: Tuesday, February 27, 2001 5:46 pm
Subject: InstantDB: Uninstalling a db or deleting a db.

> For an application i've written I wrote some tests using junit 
> that create
> an instantdb.
> 
> These tests create a prp file then create the db.
> Everything works fine.
> 
> However I would like my tests to clean up after themselves and 
> delete the
> db.
> I can drop the tables I create (User table) but I can't drop or 
> delete the
> index and key tables
> that are created by instantdb. This is because the files seem to 
> be locked.
> 
> I get access denied if I try to do a simple file delete.
> 
> Any clues as to whats happening?
> 
> I can provide code if necessary.
> I have checked and made sure that all connections and statements 
> are closed
> before I try to 
> do a file delete. Not sure why but until I exit the application 
> totally I
> can't delete those files.
> 
> I have even tried setting my connections to null and doing a 
> system.gc()
> -------------------------------------------------------------------
> ----------
> To unsubscribe from this mailing list, send email to 
> majordomo@enhydra.orgwith the text "unsubscribe instantdb" in the 
> body of the email.
> If you have other questions regarding this mailing list, send 
> email to
> the list admin at owner-instantdb@enhydra.org.
> 

----------------------------------------------------------------------------
-
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.