• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebSphere Performance Monitoring Infrastructure - Active Method Count

 
Jane Barnett
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a web application to be deployed on WAS 6.1. I am using stateless session beans with container managed transactions (CMT).

Using the Performance Monitoring Infrastructure, within WAS 6.1, I have realized that for a particular bean, the metric - ActiveMethodCount is directly proportional to the number of transactions marked for roll back. Transactions are marked for roll back when any exception is thrown within the business bean method. So if I throw 10 business exception and call setRollBackOnly 10 times, At the end of those 10 method calls, the ActiveMethodCount is 10, suggesting that I have 10 methods running concurrently. How can this be? The method has returned to it caller.

Additionally, when I use the RAD profiling tool, I see that the 10 business exceptions created during the execution of the business exception are still being referenced, preventing garbage collection, resulting in a memory leak.

The code looks like this:
Bean 1 call Bean 2: Bean 1 has a txn attribute of NEVER whilst Bean 2 has txn attribute REQUIRED

Bean1 - NEVER
public void testJob(){
for(int x = 1; x<=20; x++){
Bean2Service.testMethod(new Integer(x));
}
}

Bean2 - REQUIRED
public void testMethod(Integer x){
try{
if(x.intValue() > 10){
throw new LMSBusinessException("Bus Exp");
}
log.debug("Committing for - "+x);
}catch(Exception e){
log.debug("Rolling back for - "+x);
getSessionContext().setRollbackOnly();
}
}

Help....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic