Let us consider the following method in a stateless session
EJB having Container managed transaction demarcation with a transaction time out of
60 seconds. Due to the infinite loop the method never returns and as per documentation (weblogic) the server will not attempt to abandon the transaction.( But the transaction is marked for a rollback as demanded by EJB specification. ) Hence there is no response or exception received by the client (caller of this EJB method). Is there anyway to make the server abandon the execution of the infinite loop and log or return the Transaction Timeout Exception ?
public int add(int x, int y) {
int k=10;
while(k <100){
}
return x+y;
}