You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Svetlin Zarev (JIRA)" <ji...@apache.org> on 2017/06/09 08:55:18 UTC

[jira] [Updated] (TOMEE-2057) @BeforeCompletion callback issue

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

Svetlin Zarev updated TOMEE-2057:
---------------------------------
    Description: 
I have a @Stateful bean which has @AfterBegin & @BeforeCompletion callbacks defined. It tries to persist a JPA entity in each one of them.

During the transaction everything seems fine, but after the transaction EntityManger.find() returns null for the bean persisted during @BeforeCompletion

I've attached sample app that reproduces the issue.

*Expected result:*
The output does not contain any failed tests.

*Actual result:*
{code}
TESTING TX_REQUIRED WITHOUT EXISTING TRANSACTION
[TEST FAILED] Expecting entity for BEFORE_COMPLETION instead of: null

TESTING TX_REQUIRED WITH EXISTING TRANSACTION
[TEST FAILED] Expecting entity for BEFORE_COMPLETION instead of: null
{code}

PS: I observe a similar issue for @AfterBegin in another case, but I'm not able to extract a reproducible test case from it. But I thinkthe two issues are linked

  was:
I have a @Stateful bean which has @AfterBegin & @BeforeCompletion callbacks defined. It tries to persist a JPA entity in each one of them.

Dureing the transaction everithing seems fine, but after the transaction, the EntityManger.find() returns null for the bean persisted during @BeforeCompletion

I've attached sample app that reproduces the issue.

*Expected result:*
The output does not contain any failed tests.

*Actual result:*
{code}
TESTING TX_REQUIRED WITHOUT EXISTING TRANSACTION
[TEST FAILED] Expecting entity for BEFORE_COMPLETION instead of: null

TESTING TX_REQUIRED WITH EXISTING TRANSACTION
[TEST FAILED] Expecting entity for BEFORE_COMPLETION instead of: null
{code}


> @BeforeCompletion callback issue 
> ---------------------------------
>
>                 Key: TOMEE-2057
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2057
>             Project: TomEE
>          Issue Type: Bug
>            Reporter: Svetlin Zarev
>         Attachments: sample.zip
>
>
> I have a @Stateful bean which has @AfterBegin & @BeforeCompletion callbacks defined. It tries to persist a JPA entity in each one of them.
> During the transaction everything seems fine, but after the transaction EntityManger.find() returns null for the bean persisted during @BeforeCompletion
> I've attached sample app that reproduces the issue.
> *Expected result:*
> The output does not contain any failed tests.
> *Actual result:*
> {code}
> TESTING TX_REQUIRED WITHOUT EXISTING TRANSACTION
> [TEST FAILED] Expecting entity for BEFORE_COMPLETION instead of: null
> TESTING TX_REQUIRED WITH EXISTING TRANSACTION
> [TEST FAILED] Expecting entity for BEFORE_COMPLETION instead of: null
> {code}
> PS: I observe a similar issue for @AfterBegin in another case, but I'm not able to extract a reproducible test case from it. But I thinkthe two issues are linked



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)