You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Tomohito Nakayama (JIRA)" <de...@db.apache.org> on 2005/07/21 13:40:50 UTC

[jira] Resolved: (DERBY-397) Make it sure for the connection to be closed in drda.Database#close() even if Exception happens in conn.rollback().

     [ http://issues.apache.org/jira/browse/DERBY-397?page=all ]
     
Tomohito Nakayama resolved DERBY-397:
-------------------------------------

    Resolution: Won't Fix

I concluded to do nothing for DERBY-397 for now.

Reasons were as next.

1:
EmbedConnection , which drda module uses , assumes transaction is inactive when connection was closed.
Then, it is illegal in current structure of drda module to close connection when rollback was failed.

// I came to suspect that it is not good structure for drda module to use EmbedConnection directly .


2:
There are no fact that it causes obvious problem not to call close in drda.Database#close() when rollback() was failed .
On the other hand, there are risks to call close when rollback() was failed and not calling rollback().

It seems to be  lesser profit and more danger.


3:
At least Database#close() ensure Database#conn to be null and we can expect EmbedConnection#finalize() to be called.

http://article.gmane.org/gmane.comp.apache.db.derby.devel/6668

> Make it sure for the connection to be closed in drda.Database#close() even if Exception happens in conn.rollback().
> -------------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-397
>          URL: http://issues.apache.org/jira/browse/DERBY-397
>      Project: Derby
>         Type: Sub-task
>   Components: Network Server
>     Reporter: Tomohito Nakayama
>     Assignee: Tomohito Nakayama
>  Attachments: derbyall_pass.txt, derbyall_report.txt, jdbcTrans.java, surveyDERBY397.patch.txt
>
> If exeption was happen in conn.rollback() In the code of drda.Database#close, 
> that connection was not closed and would be leaked.
> http://svn.apache.org/repos/asf/incubator/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java
> Make it sure to close connection between drda and engine, when drda.Database#close was called.

-- 
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