This discussion is taking place on the user list. It is my understanding
that graceful engine shutdown is supposed to remove references to Derby
classes, making all of the engine code eligible to be garbage-collected.
At least, that is what I thought Lily implemented for 10.8.
In the discussion below, the user is expecting that garbage-collection
will happen after shutting down a single database. I wouldn't expect
that. But it got me to wondering how a user is supposed to shutdown the
engine gracefully via the Derby DataSources. I know how to do this by
passing a shutdown URL to DriverManager, but how do you do this via a
DataSource?
Thanks,
-Rick
-------- Original Message --------
Subject: Re: Can't remove derby from memory
Date: Mon, 26 Mar 2012 18:06:24 -0700
From: Bryan Pendleton <[email protected]>
Reply-To: Derby Discussion <[email protected]>
To: Derby Discussion <[email protected]>
room. I have noticed that no matter what I do, the ~10MB of memory that is
taken when the database connect is initiated is held no matter what commands
Certainly sounds like the database isn't getting fully shut down.
dynamDS.setShutdownDatabase("shutdown");
It's not clear to me that this does anything by itself. The docs say:
If set to the string "shutdown", this will cause the database to shutdown
when a java.sql.Connection object is obtained from the data source. E.g.,
If the data source is an XADataSource, a getXAConnection().getConnection()
is necessary to cause the database to shutdown.
This sounds like you have to get a final connection (and then close it) after
setting ShutdownDatabase.
Did you try getting a connection after calling setShutdownDatabase?
thanks,
bryan