You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2013/03/14 10:26:12 UTC

[jira] [Comment Edited] (DELTASPIKE-310) Support for TransactionAttributeType REQUIRE_NEW

    [ https://issues.apache.org/jira/browse/DELTASPIKE-310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557365#comment-13557365 ] 

Gerhard Petracek edited comment on DELTASPIKE-310 at 3/14/13 9:25 AM:
----------------------------------------------------------------------

there isn't a portable way to do it for 'RESOURCE_LOCAL' transactions.
(e.g. it would be only compatible with dependent- and transaction-scoped entity-managers.
since the current implementation of @Transactional isn't compatible with dependent-transaction-scoped entity-managers, we could only support transaction-scoped entity-managers.)
                
      was (Author: gpetracek):
    there isn't a portable way to do it for 'RESOURCE_LOCAL' transactions
                  
> Support for TransactionAttributeType REQUIRE_NEW 
> -------------------------------------------------
>
>                 Key: DELTASPIKE-310
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-310
>             Project: DeltaSpike
>          Issue Type: Improvement
>          Components: JPA-Module
>    Affects Versions: 0.4-incubating
>            Reporter: Alexis Krier
>             Fix For: 0.5-incubating
>
>
> @Transactional currently open a transaction when method is invoked.
> if a sub method is invoked also annoted @Transactional the second method uses the first method transaction and not a new one.
> ex:
> @Transactional
> void createEntity(){
>   ...
>   audit()
>    throw Exception("a problem occurs here")
> }
> @transactional
> void audit(){
>    //persist some audit stuff
>    ...
> }
> Actually everything is rolled back because of the exception in the top method (createEntity)
> @transactional should have a parameter like (REQUIRE_NEW, NEVER...) to handle with details transaction's lifecycle

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira