Results 1 to 3 of 3

Thread: Pre-Interceptor in TransactionProxyFactory

  1. #1
    Join Date
    Sep 2004
    Posts
    9

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    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
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Sep 2004
    Posts
    9

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •