Subject Re: Firebird - true disconnection
Author vandy899
--- In Firebird-Java@yahoogroups.com, "Ron Wilcom" <ron.wilcom@n...>
wrote:
> Michael - gc() FYI - calling System.gc() or Runtime.getRuntime().gc()
> never guarantees that an unreferenced object is actually cleaned up.
> This depends on its place in the current pecking order beyond "Eden" in
> "young memory" - there are multiple survivors at this level and finally
> an object may be moved on to "old memory" - if it makes it to old memory
> then the garbage collector will expunge it.
>
>
>
> For a lesson on garbage collection see:
>
> http://java.sun.com/docs/hotspot/gc/
> <http://java.sun.com/docs/hotspot/gc/>
>
>
>
>
>
> -----Original Message-----
> From: vandy899 [mailto:vandy899@y...]
> Sent: Thursday, January 27, 2005 7:04 PM
> To: Firebird-Java@yahoogroups.com
> Subject: [Firebird-Java] Re: Firebird - true disconnection
>
>
>
>
>
> --- 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
>
>
>
>
>
>
>
>
>
> _____
>
> Yahoo! Groups Links
>
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/Firebird-Java/
>
>
> * To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
> <mailto:Firebird-Java-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
>
>
>
> [Non-text portions of this message have been removed]
Yeah, I know. But more than likely, if you've set the thing to null,
it most likely won't survive... Of course, with C you get to screw it
up all by yourself :) Wouldn't it be nice if you could force
deallocation of a particular thing in java...