• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception in calling execute method of CallableStatement

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My application is running for a while. Usually 2 weeks once , we get the exception in JDBC call and we restart the application and it runs fine. Finally we found the source of the exception. It's from execute() method of callableStatement. The call returns exception. But there is no information in the exception object. The getMessage() function of Exception returns null and there is no stack trace.

The callableStatement execute() is being called continuously to get the record one by one. This functionality is coded in Servlet.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Makesh,
I don't see the finally block where you close the resources. Maybe you have a resource leak causing the problem.
 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeanne,

I assure you that finally block is in place. I think that is not a problem. if there are more connections open, I could find out in DBA session.

Makesh
 
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if the error is in the execute() then there is some JDBC implementation constraint that you are not property using.

From the code it looks like you are catching all possible exceptions and logging them. I am sure if you print the stack trace you will get a lot of information.

If you paste this information, then you get posts from people who have already been there and fixed the problem

Also, though not suggested, use catch (Throwable t) instead of catch(Exception e) and print the error, it is possible that the JDBC implementation is throwing an Error and not an Exception.
[ August 08, 2008: Message edited by: Raj Chila ]
 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your suggestion to use Throwable instead of Execption is a good one. I will try that one.

There is no stack trace. getMessage() of Exception returns null.

FYI, this execute method successfully ran for one month and each day it was executed more than thousand times. So I don't think I am setting some wrong properties.

Thank you for your suggestion. Your inputs are welcome.

Makesh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic