Results 1 to 4 of 4

Thread: JamonPerformanceMonitorInterceptor registers double

  1. #1

    Default JamonPerformanceMonitorInterceptor registers double

    Having the following definitions:
    Code:
     <aop:config proxy-target-class="true">
      	<aop:advisor 
      		advice-ref="jamonInterceptor"
      		pointcut="execution(* abc.Test.query(..))"/>
    
      </aop:config>
    
      <bean id="jamonInterceptor" class="org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor">
            <property name="trackAllInvocations" value="true"/>
        </bean>
    JAMon (jamonadminapi.jsp) shows 2 hits, while the intercepted Test.query method is actually called just once (verified by debugging and by tracing). JAMon shows identical execution time for the "two" executions, and LastAccess time = FirstAccess time.
    I have of course tried several times, resetting JAMon between each try.

    Has anyone experienced similar "double" hits in JAMon, and even have an explanation and a solution?

  2. #2

    Default

    I found a connection between the double JAMon hits and session scope / <aop:scoped-proxy/>.
    This gives double hits:
    Code:
    <bean id="test" class="abc.Test" scope="session">
         <aop:scoped-proxy/>
    </bean>
    while this gives just the expected single hits:
    Code:
    <bean id="test" class="abc.Test">
    </bean>
    (The abc.Test class is referenced from a singleton bean).

    Is there a way to avoid these double hits?
    Last edited by mortenhaugen; Jan 10th, 2007 at 12:45 PM.

  3. #3
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    Setting a breakpoint in Test.query might give you some insight into where Spring is calling it twice.
    Bill

  4. #4

    Default

    Spring does not call Test.query twice. It's just the JamonPerformanceMonitorInterceptor that registers the call twice when the Test bean is in session scope (and thus proxied). I suspect the proxying to cause the double interception/registration...

Posting Permissions

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