Subject | Re: Should (Could) FBStatements be held in WeakHashMap |
---|---|
Author | Roman Rokytskyy |
Post date | 2003-04-04T20:11:21Z |
David,
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
> Well, let me recommend using jboss. (or possibly another appI'm afraid, this will not help. Mark had following problem:
> 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.
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