aspose file tools*
The moose likes JDBC and the fly likes setQuerytimeout in CallableStatement not working. Kindly please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "setQuerytimeout in CallableStatement not working. Kindly please help" Watch "setQuerytimeout in CallableStatement not working. Kindly please help" New topic
Author

setQuerytimeout in CallableStatement not working. Kindly please help

Raj Shan
Ranch Hand

Joined: Sep 04, 2006
Posts: 65
In Message broker, from Java compute node, I am calling a oracled stored procedure using callable statement. In that I am setting the timeout using setQueryTimeout() and I am setting the time as 30 secs. When I invoke the stored procedure, the stored procedure is not timing out in exactly 30 secs. For example, we tested like this.

1. we put a sleep of 3 mins with in the oracle stored procedure
Eventhough I set the timeout as 30 secs, it did not timeout soon after 30 secs but after 3 mins + (6 to 10 secs). Why is time out not happening in 30 secs?
Also in some scenerios, I am not getting SQLException at all, the stored procedure is returning the actual input xml. why is that?

Can someone help me out with this query please?
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
See "Oracle® Database JDBC Developer’s Guide and Reference, 11g Release 1 (11.1)" - note on page 1-3:
JDBC Server-Side Internal Driver
The JDBC server-side internal driver supports any Java code that runs inside Oracle
Database, such as in a Java stored procedure
, and must access the same database. It
lets the Java Virtual Machine (JVM) to communicate directly with the SQL engine. This
driver supports only JDK 1.5.
The JDBC server-side internal driver, the Oracle JVM, the database, and the SQL
engine all run within the same address space, and therefore, the issue of network
round-trips is irrelevant. The programs access the SQL engine by using function calls.

Note:
The server-side internal driver does not support the cancel and setQueryTimeout methods of the Statement class.

Raj Shan
Ranch Hand

Joined: Sep 04, 2006
Posts: 65
But I am connecting to the database using the thin driver, jdbcracle:thin:@. Please let me know if this applies to thin server side driver as well?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setQuerytimeout in CallableStatement not working. Kindly please help