You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2015/12/10 22:59:11 UTC

[jira] [Resolved] (KARAF-4122) Custom interceptor prohibits declarative transactions

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

Christian Schneider resolved KARAF-4122.
----------------------------------------
    Resolution: Invalid
      Assignee: Christian Schneider

I found that transactions work if your <int:enable/> Element is added after the <tx:enable/> but not if it is added before.

After long debugging I found that your BeanProcessor registers an interceptor on every bean including the AnnotationProcessor of blueprint.transaction. This effectively disables the transaction processor.

So the trick is to selectively register your Processor. At a minimum you should not register with any other Processor.
I created a pull request that should fix your code:
https://github.com/fwassmer/transaction-chain/pull/1

Probably we should document this in Aries Blueprint.

> Custom interceptor prohibits declarative transactions
> -----------------------------------------------------
>
>                 Key: KARAF-4122
>                 URL: https://issues.apache.org/jira/browse/KARAF-4122
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.0.3
>         Environment: Karaf 4.0.2 + 4.0.3, Windows 7 x64, Oracle jdk 1.8
>            Reporter: Felix Wassmer
>            Assignee: Christian Schneider
>
> When using declarative transactions in Karaf 4 (Aries transaction blueprint 2.0.0), 
> adding a custom interceptor seems to conflict with the aries TxInterceptor.
> Expected behavior
> Interceptor enabled for service A
> Service A with TxType.REQUIRED calls service B with TxType.MANDATORY and service B will be executed in a transaction.
> Actual behavior
> Service B throws exception:  No transaction present when calling method that mandates a transaction.
> (TxInterceptor was not registered for service A and therefore no tx started)
> Disabling the interceptor (removing declaration in blueprint), 
> transactional behaviour works as expected (B is executed in a transaction).
> Custom interceptor + tx behavior works as expected when using transaction blueprint 1.1.1 and delcaring transactions in blueprint.
> Example to reproduce the issue:
> https://github.com/fwassmer/transaction-chain/



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