[
https://issues.apache.org/jira/browse/JDO-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14537966#comment-14537966
]
Tilmann Zäschke commented on JDO-735:
-------------------------------------
I just realised that auto-close will re-throw the inner exception, not the
exception from a close() attempt.
This leaves the discussion whether JDO should at least attempt to abort() a
transaction before closing it. This may make things easier depending on the
recovery mechanism of the database.
Personally, I would find it useful if close() would abort a transaction, but I
suppose that has been discussed before elsewhere in detail.
> Make PersistenceManager and Query support AutoCloseable (JDK1.7+)
> -----------------------------------------------------------------
>
> Key: JDO-735
> URL: https://issues.apache.org/jira/browse/JDO-735
> Project: JDO
> Issue Type: New Feature
> Components: api, specification, tck
> Reporter: Andy Jefferson
> Fix For: JDO 3.2
>
>
> So then it can be used with JDK1.7+ try-with-resources, as per
> http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)