[
https://issues.apache.org/jira/browse/ARIES-1438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Schneider resolved ARIES-1438.
----------------------------------------
Resolution: Fixed
commit 1b027d2795d702bb7fc076b6a4790c2f2ddcce7f
Author: Christian Schneider <[email protected]>
Date: Tue Oct 27 15:06:35 2015 +0100
[ARIES-1438] Fixed NPE with thanks to Matthew Pitts
> NPE in XAJpaTemplate#txExpr if Coordinator is null
> --------------------------------------------------
>
> Key: ARIES-1438
> URL: https://issues.apache.org/jira/browse/ARIES-1438
> Project: Aries
> Issue Type: Bug
> Components: JPA
> Affects Versions: jpa-2.2.0
> Reporter: Matthew Pitts
> Assignee: Christian Schneider
> Fix For: jpa-2.3.0
>
> Attachments: org.apache.aries.jpa.support.patch
>
>
> XAJpaTemplate uses the following code to initialize the transaction and later
> calls Coordinator#end in a finally block.
> {code:java}
> TransactionAttribute ta = TransactionAttribute.fromType(type);
> Coordination coord = null;
> try {
> tranToken = ta.begin(tm);
> coord = coordinator.begin(this.getClass().getName(), 0);
> {code}
> However, if the call to _ta.begin(tm)_ fails, then the _coord_ reference will
> be null, thus provoking an NPE during the finally block. This will then
> suppress the original exception that prevented _ta.begin_ from succeeding.
> A null-check on _coord_ prior to the invocation of Coordinator#end should
> suffice to fix this, but perhaps there's another problem here.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)