Hi ,
I have few EJB methods which does some database operations, I am observing that the method call returns to the parent method after a while like 400 milliseconds.
I believe the whole time may be eaten up while committing the transaction into DB. And it happens frequently.
e.g.
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void processEvent(Message message)
{
log.info("Calling processMain ");
processorBO.processMain(message);//processorBO is an EJB
log.info("After Call processMain ");
}
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void processMain(Message message){
log.info("Calling saveMessage ");
messageDao.saveMessage(message);
log.info("After Call saveMessage ");
}
Here is the Out out :
12 Oct 2017 07:09:06,645 -0400 INFO[sdsthread-17] Calling processMain
12 Oct 2017 07:09:06,645 -0400 INFO[sdsthread-17] Calling saveMessage
12 Oct 2017 07:09:06,649 -0400 INFO[sdsthread-17] After Call saveMessage
12 Oct 2017 07:09:07,115 -0400 INFO[sdsthread-17] After Call processMain
You can observer the Line 4 and Line 5 has a time difference of 400 milliseconds.
How can we solve this problem.