Announcement Announcement Module
Collapse
No announcement yet.
Pre-Interceptor in TransactionProxyFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pre-Interceptor in TransactionProxyFactory

    Hi

    I have a bean(say SampleTxnSupportBean) which is retrieved from the TransactionProxyFactory to provide Transaction support for its Methods( sampleMethodOne, sampleMethodTwo and sampleMethodThree).

    I also have a pre-interceptor(methodnamematcher) which based on certain information in the methods will invoke a different method.
    For exl. if sampleMethodOne is invoked, the pre-interceptor will check the param information and decide to call either sampleMethodTwo or sampleMethodThree.

    This works fine except once the sampleMethodTwo is called the Transaction control is no longer applicable, it could be due to the fact that once inside the interceptor no other interceptor will get recognized on that method, in this case since it is already inside TxnInterceptor for sampleMethodOne , it won't get invoked again for sampleMethodTwo if it is invoked in the preinterceptor.

    is my perception correct ? how can i overcome this issue?

    Thanks

  • #2
    You could use the following in your Advice:
    Code:
    return ((MyTargetClass) AopContext.currentProxy()).sampleMethodTwo();
    do not forget to set property "exposeProxy" to true in your TransactionProxyFactory.
    HTH

    Comment


    • #3
      Hi

      Thanks..i also saw you have referred the same approach to queries in DataAccess and Aop forums..also you mentioned that it is "intrusive" as it makes the BusinessObject exposed to the spring ..but guess this is the only option i have got now.

      Comment

      Working...
      X