Subject | Re: Should (Could) FBStatements be held in WeakHashMap |
---|---|
Author | Roman Rokytskyy |
Post date | 2003-04-04T16:02Z |
Mark,
Can you provide more details for this example?
provide some code? (I have a feeling that weak references will not
solve your problem, but even might cause "statement already closed"
errors).
Statement stmt = null;
try {
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
} finally {
if (stmt != null) stmt.close();
}
don't they?
simultaneously from the same server.
Best regards,
Roman
Can you provide more details for this example?
> In my case (to help explain why I get such a simple error) it'sWhat is hidden in Interator.next()? Statement allocation? Can you
> hidden within an instance of an Iterator,object which didn't
> explicitly call the .close() object when scope was lost, and that
> depended upon the whim of the user of reading until the end of the
> result set.
provide some code? (I have a feeling that weak references will not
solve your problem, but even might cause "statement already closed"
errors).
> But I can see this occuring in a program if say Exceptions occurCorrect me, but all JDBC tutorials have typical constructs like:
> occasionally, that then forget to call close(), and it will only be
> after running for 4 days the program will crash after gradually
> slowing down (since they end up having 20,000 open stmts to the
> server).
Statement stmt = null;
try {
stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(sql);
} finally {
if (stmt != null) stmt.close();
}
don't they?
> (MS JAVA you see was being soThis seems to be IE limitation, try to dowload more than two files
> standards compilant that it would only allow a maximum of two
> concurrent connections to a remote server at one time,
simultaneously from the same server.
Best regards,
Roman