I have a problem with a deadlock. The code is well complex and I cannot find which line the query is being generated from. How can I find the method that's calling hibernate. Can I log it or see it or change the log4j ? I can already see the hibernate sql that generates the deadlock but short of debugging thousands lines of code, is there an easy way to figure out which method has issued the hibernate call that generated the deadlock ?