+1 on the renaming, the layers of abstraction in this area of code are confusing enough as it is... :)

David

Daniel John Debrunner wrote:

I think I just noticed an bug with the new query timeout function, I
should have seen it during the review.

The timeout is being set on the class GenericPreparedStatement, but this
represents a statement plan and can be shared across multiple
connections (through the statement cache). Thus if two connections
execute the same statement with different timeouts, they will interfere
with each other with the timeout values.

I think the solution is to pass the timeout into the execute method of
org.apache.derby.iapi.sql.PreparedStatement, not store it as a field in
GenericPreparedStatement.


[ aside: Re-naming these classes to *Plan instead of *Statement might
might the code easier to understand as they are not directly related to
java.sql.PreparedStatement and do not behave like JDBC's PreparedStatement.

org.apache.derby.impl.sql.GenericPreparedStatement
org.apache.derby.iapi.sql.execute.ExecPreparedStatement
org.apache.derby.iapi.sql.PreparedStatement

end of aside ]

Dan.

begin:vcard
fn:David W Van Couvering
n:Van Couvering;David W
org:Sun Microsystems, Inc.;Database Technology Group
email;internet:[EMAIL PROTECTED]
title:Senior Staff Software Engineer
tel;work:510-550-6819
tel;cell:510-684-7281
x-mozilla-html:TRUE
version:2.1
end:vcard

Reply via email to