db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kim Haase (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DERBY-5910) Document use of Connection.close() with try-with-resources
Date Thu, 18 Oct 2012 19:18:04 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kim Haase resolved DERBY-5910.
------------------------------

          Resolution: Fixed
       Fix Version/s: 10.10.0.0
                      10.9.1.1
                      10.8.2.3
    Issue & fix info:   (was: Patch Available)

Thanks again, Rick.

Committed patch DERBY-5910-4.diff to documentation trunk at revision 1399767. 
Merged to 10.9 doc branch at revision 1399778.
Merged to 10.8 doc branch at revision 1399798.

                
> Document use of Connection.close() with try-with-resources
> ----------------------------------------------------------
>
>                 Key: DERBY-5910
>                 URL: https://issues.apache.org/jira/browse/DERBY-5910
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.9.1.0
>            Reporter: Kim Haase
>            Assignee: Kim Haase
>             Fix For: 10.8.2.3, 10.9.1.1, 10.10.0.0
>
>         Attachments: DERBY-5910-2.diff, DERBY-5910-2.zip, DERBY-5910-3.diff, DERBY-5910-3.zip,
DERBY-5910-4.diff, DERBY-5910-4.zip, DERBY-5910.diff, DERBY-5910.stat, DERBY-5910.zip
>
>
> The Java SE 7 try-with-resources feature can cause problems with AutoCloseable objects
like java.sql.Connection. You must be careful when writing portable code which declares Connections
in the initializers of try-with-resources blocks, because Derby raises an exception if you
try to close a Connection with uncommitted work in-flight. 
> Changing Derby's Connection.close() to always commit in-flight work (and not raise an
exception) would create backward compatibility issues, but we do not know yet how serious
these issues would be, owing to a lack of data.
> Rather than change Derby's behavior now, we should document how Derby's Connection.close()
behaves and describe the portability issues involved in declaring Derby Connections in try-with-resources
initializers. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message