I have nearly finished implementing wrapped connections. This means that
every time we serve a connection then we wrap it up in a disposable
object. That way, once it is closed (i.e. returned to the pool) then
subsequent operations no longer mess with the internal connection (which
might be being used by someone else by this point).
Anyone know how a Connection should behave if you close it and then do
something to it? Here's a list of all the methods (for JDK 1.4). I've
grouped them into:
Should still work:
isClosed
hashcode
finalize (protected anyway)
clone ?
equals
toString
Should throw an exception:
clearWarnings
commit
createStatement
getWarnings
prepareCall
prepareStatement
releaseSavepoint
rollback
Should be silently ignored:
close (API says it is a no-op)
I think that all of these should probably throw an exception:
getAutoCommit
getHoldability
getTransactionIsolation
getTypeMap
isReadOnly
nativeSQL
setAutoCommit
setCatalog
setHoldability
setReadOnly
setSavepoint
setSavepoint
setTransactionIsolation
setTypeMap
- Bill
|