I saw an interesting post on the Amis blog posted by Lucas Jellema and titled "Who is calling me? - Analyzing the Java Callstack
" this evening about finding out who is a Java class invoked the method. The trick
Lucas is showing is to create a new throwable and to then inspect the stacktrace. Lucas then goes through some example code. This is a very useful post and reminds me of Tom's similar methods for finding out who called a function or procedure but for PL/SQL - in fact similarly named who_called_me
. There is an example of its use on a page titled "How Can I find out who called me or what my name is
" and the code or who_called_me and who_am_i is available here
. I have changed the links to be asktom links that I found on Tom's site as they were pointing at osi.oracle.com - which Tom told me some time ago are not valid anymore.