db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1095) Closing an embedded connection does not seem to close associated EmbedStatements
Date Fri, 10 Mar 2006 17:08:21 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1095?page=comments#action_12369887 ] 

Daniel John Debrunner commented on DERBY-1095:
----------------------------------------------

I wouldn't actually describe this as a bug, it's more an internal issue. As far as the application
is concerned the Statement and ResultSet's are closed.
I see it as really  an internal optimization. 

I do think it needs to be fixed, I don't think the Connection having a list of open statements
and calling close on them is the way to go.
I've been thinking about ways to fix this related to DERBY-538  where an application holding
onto an open statement or result set
might hold onto the class loader indirectly and thus keep an open file. I was thinking about
addressing this in the language connection
context, where the real list of active resources is held.

Not sure why it blocks DERBY-953, if all the other statements can detect if the Statement
has been automatically closed,
why can't isClosed? Seems like the proposed implementation of that method is insufficient.

> Closing an embedded connection does not seem to close associated EmbedStatements
> --------------------------------------------------------------------------------
>
>          Key: DERBY-1095
>          URL: http://issues.apache.org/jira/browse/DERBY-1095
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Versions: 10.2.0.0
>     Reporter: Kristian Waagan
>     Priority: Minor
>  Attachments: Derby1095Repro.java
>
> Closing an embedded connection (calling EmbedConnection.close()) does not seem to close
associated EmbedStatements. 
> The severity of the bug is not determined. The least severe case is that the internal
EmbedStatement variable 'active' is not updated accordingly, the most severe case is that
the the resources bound to EmbedStatement will not be viable for garbage collection until
the EmbedStatement itself is (if user keeps references to it).
> If methods on the statement are called, Derby will correctly throw an NoCurrentConnection
exception, but the close() method is still never called automatically.
> The problem also seem to extend down to ResultSet.isClosed(), but this is probably due
to the bug in EmbedStatement.
> Problem detected while fixing DERBY-953; implement Statement.isClosed().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message