1

I have a strange problem, here is a quick snapshot of the system: I have a web application which calls local EJB bean, lets call the local EJB 'LocalEJB', this EJB calls remote EJB - 'RemoteEJB' method which does some processing on the external system and returns the String result. All happens within Weblogic 8.1

Here is an example processing:

Web application:

//create reference to the local bean  
locHome = (LocalHome)ServiceLocator.getInstance().getLocalHome("ejb/localejb");

beanRef = locHome.create();  //call the bean method  
String result = beanRef.updateSmth(data.getId(),data.getRelatedIds(),Integer.valueOf(data.getState()));

//print the result  
LOG.debug("result is: " + result);

I have a logging enabled on the local bean inside ejb application:

log.debug("state " + state);

res = session.updateSmth(id, relatedIds, state);

log.debug("result inside bean call: " + res);

Where 'session' is a reference to the remote bean.

Now what happens, the request comes to the application, the method 'beanRef.updateSmth' executes, this calls method inside local ejb, after a second or two I can see in the log file that for eg. 'result inside bean call: 0231423', which means the remote bean returned the result, but I have to wait sometimes 5-6 minutes until I see the result inside my web application (statement 'LOG.debug("result is: " + result);'). What takes so long to pass the results to the web application, is it the transaction commiting (the local bean has 'Required')?

I can see in the weblogic config xml file that transaction timeout is set to 1800 seconds but does it really matter if the results are ready to return straight away?

Kris
  • 5,714
  • 2
  • 27
  • 47
  • sorry, couldnt format the source code any better – Kris Jul 21 '11 at 06:33
  • I'd suggest getting stack traces or using a profiler or debugger to narrow the problem. There's probably not enough information here for someone to be able to solve the problem. – Brett Kail Aug 08 '11 at 14:40

1 Answers1

2

As expected, it was actually caused by container waiting to commit the transaction. The database record was locked and prevented the container to commit the transaction causing the timeout in the end.

Kris
  • 5,714
  • 2
  • 27
  • 47