Subject Re: Should (Could) FBStatements be held in WeakHashMap
Author Roman Rokytskyy
David,

> Well, let me recommend using jboss. (or possibly another app
> server). The jca stuff combined with the ejb containers lets jboss
> track which connections were obtained by which ejbs, and if you
> leave one open when your method call returns, you can get jboss to
> close (the handle) for you.

I'm afraid, this will not help. Mark had following problem:

for (int i = 0; i < 40000; i++)
Statement stmt = con.createStatement();

On i = 20000 it will break because server runs out of statement
handles. Mark suggested to use weak reference, so that when stmt
becomes weakly reachable, garbage collector will invoke stmt.finalize
() that in turn will close that statement (and release server
resources). This happened within a method body.

Thanks!
Roman