cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CAY-2110) Obfuscated exception when processing iterated results
Date Tue, 06 Sep 2016 09:01:20 GMT

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

Andrus Adamchik closed CAY-2110.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 4.0.M4

The real fix is in CAY-2111. Here I just added a few sanity checks to TransactionResultIteratorDecorator
to validate inputs.

> Obfuscated exception when processing iterated results
> -----------------------------------------------------
>
>                 Key: CAY-2110
>                 URL: https://issues.apache.org/jira/browse/CAY-2110
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 4.0.M3
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Minor
>             Fix For: 4.0.M4
>
>
> This was reported by a user. I don't have a full test case yet, but I think we can easily
build it. Iterated query throws the following exception:
> org.apache.cayenne.CayenneRuntimeException: [v.4.0.M4.4937cd0 May 25 2016 12:27:14] java.lang.IllegalStateException:
Transaction must have 'STATUS_ACTIVE' to be committed. Current status: STATUS_MARKED_ROLLEDBACK
> 	at org.apache.cayenne.access.TransactionResultIteratorDecorator.close(TransactionResultIteratorDecorator.java:67)
> ...
> Caused by: java.lang.IllegalStateException: Transaction must have 'STATUS_ACTIVE' to
be committed. Current status: STATUS_MARKED_ROLLEDBACK
> 	at org.apache.cayenne.tx.BaseTransaction.commit(BaseTransaction.java:126)
> 	at org.apache.cayenne.access.TransactionResultIteratorDecorator.close(TransactionResultIteratorDecorator.java:60)
> 	... 12 more
> What seems to happen is an uncaught exception during iteration, and a call to "close"
in the "finally" method of the iterator attempts to commit transaction that is already in
the ROLLBACK state. Looks like we need to check transaction state inside 'TransactionResultIteratorDecorator.close()'
before committing... If it is not ready to be committed, it should be rolled back.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message