Previously i was using spring
jdbc template for persistence. Recently I was trying to use hibernate 3.2 while JPA annotations which eliminates the need for hibernate mapping xml files - all these are manged with Spring framework. Now I encounter one strange problem. I have one worker
thread which retrieves some requests periodically and service them accordingly. I wrapped my code inside try{}catch(Throwable e){} within an infinite loop but i noticed that worker thread some times disappears (loop breaks) and it does not enter the catch block! Naturally I was confused with this behaviour since i believe that any exception should enter catch block.
After some googling i found UncaughtExceptionHandler. Inside uncaughtException function i simply log the error and its was great NullPointerException. So i was assuming that while hibernate making some query and finding NULL in some column, it catches the exception and not allowing it to bubble up. But i am not getting why the thread crashed !! It is making me really confused. Can you please show me some light.
Thanks in advance.