Subject Re: [Firebird-Java] How to make the garbage collector collect
Author Roman Rokytskyy
> I am writing webapps, that use Firebird databases. I have on db for
> every service and wanted to know if there is any possibility to
> get my XSQLVARs garbage collected other than to shutdown my
> FBWrappingDataSource und create a new instance.

By default pool has also statement pooling switched on. That means that even
after closing the pooled connection, physical connection will reference
prepared statements and ready for use. Set the "maxStatements" property to
0, it will switch the statement pooling off. In this case closing the
prepared statement will also deallocate all structures incl. XSQLVAR and

But my question is: do they cause any troubles in your application?

> Btw. it's not possible to:
> FBWrappingDataSource fbWrapDs = new FBWrappingDataSource();
> fbWrapDs.setDatabase("//" + URL + ":" + PORT + "/" +
> db = new Firebird(fbWrapDs.getConnection());
> ... do smth ...
> fbWrapDs.getConnection().close();
> fbWrapDs.shutdown();
> fbWrapDs.restart();

If I'm not mistaken, simple restart() should be enough. But the
NullPointerException is clear bug and should not be there. Please fill a bug
report, I will fix this in next point release.