Subject Re: Firebird - true disconnection
Author vandy899
--- In Firebird-Java@yahoogroups.com, "rwilcom" <ron.wilcom@n...> wrote:
>
> I am trying to get my data source connection pool to *really*
> disconnect from the database. The application has remained JDBC
> agnostic and therefore is not using JBird's pooling - it uses the
> Apache commons pool. When I call .close() on that datasource the
> database file is not released - for example, I cannot overwrite it
> with a restore. It appears that internally the connections are
> only 'nulled' out. Once garbage collection runs on the nulled out
> connection objects then the file is free for overwrite; however,
> with Java there is no guarantee this will run when I want it to or
> those objects will be candidates for clean up when I need them to be?
>
> Questions:
> 1) Generally speaking, is there anyway to ensure that the database
> has been fully disconnected programmatically (while the VM is still
> active)?
> 2) Does the JBird driver behave in this manner if you do a
> connection close (just internally nulling out its true connection)?
> 3) Does the JBird driver offer anything that could facilitate
> this "hard disconnect" of the database?
> 4) Does Firebird offer anything (besides bumping the service) to
> hard disconnect all connections?
> 5) (Roman) Why would a connection pool only null out the
> connections - isn't there a low level call to really close the
> connection?
>
> Thanks - as usual I expect great responses from this user group
> (since its one of the best user groups I have ever joined!).
>
> Ron

Well, if it goes when the thing is garbage collected, you *could*
always force it to garbage collect... :) You do that like so:

Runtime r = Runtime.getRuntime();
r.gc();

Cheers,

Michael