Tuesday, August 9, 2011

Use of finally block in Java

Problem statement: We noticed in Production that not all orders have entries in Audit tables.
We are calling audit in the finally() block for each process order call since all success and failure orders should be audited.

Fair point, is finally() block is called every time? yes, JVM spec says it is called. See patterns of calling in this post.

However there are do & don'ts -- see this. Where it says problems with exceptions & use of return statements in finally block. Nothing of this sort is seen in our code.

Then what could be the root cause?

No comments:

Post a Comment