You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2016/01/24 21:05:39 UTC

[jira] [Resolved] (OWB-1111) firing a during-transaction event fails if the tx is already rolled back or not active

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

Mark Struberg resolved OWB-1111.
--------------------------------
    Resolution: Fixed

also deliver the event to AFTER_SUCCESS if there is no active transaction. This is for backward compat with CDI-1.0.
Rest is moved forward as recommendation to the CDI-2.0 EG.

> firing a during-transaction event fails if the tx is already rolled back or not active
> --------------------------------------------------------------------------------------
>
>                 Key: OWB-1111
>                 URL: https://issues.apache.org/jira/browse/OWB-1111
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Java EE Integration
>    Affects Versions: 1.2.8, 1.6.2
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 1.6.3
>
>
> Consider you have an observer method like
> {code}
> public void clearCacheAfterTx(@Observes(during=TransactionPhase.AFTER_COMPLETION) ClearAfterTx payload) {...}
> {code}
> and you fire the event
> {code}
> clearCacheEvent.fire(new ClearCacheEvent());
> {code}
> In this case firing the event currently blows up if the underlying transaction is already closed or rolled back. This happens because the transaction spec states that you cannot register a tx Synchronisation in certain states:
> https://docs.oracle.com/javaee/6/api/javax/transaction/Transaction.html#registerSynchronization%28javax.transaction.Synchronization%29



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