Specify IBatis query timeout
Asked Answered
O

1

5

There is a way to specify IBatis query timeout using oracle jdbc and Java?

Thanks

Ocko answered 5/10, 2010 at 17:13 Comment(0)
S
7

From the iBatis manual :

in the <settings> element :

defaultStatementTimeout

(iBATIS versions 2.2.0 and later) This setting is an integer value that will be applied as the JDBC query timeout for all statements. This value can be overridden with the “statement” attribute of any mapped statement. If not specified, no query timeout will be set unless specified on the “statement” attribute of a mapped statement. The specified value is the number of seconds the driver will wait for a statement to finish. Note that not all drivers support this setting.

on the statement paremeters :

timeout

(iBATIS versions 2.2.0 and later only)

Sets the JDBC query timeout for this statement. Any value specified here will override the value specified in the “defaultStatementTimeout” setting in the SQLMapConfig.xml file. If you specify a default timeout and decide that you don't want a timeout for a particular statement, set the timeout value to 0. The specified value is the number of seconds the driver will wait for a statement to finish. Note that not all drivers support this setting.

The oracle drivers support this functionality, so this should work.

Saarinen answered 5/10, 2010 at 17:34 Comment(2)
Hi Peter, is there any list available that shows the drivers are supported? We are trying to use these parameters using the driver com.ibm.as400.access.AS400JDBCDriver. Do you know if this driver is supported or if there is another approach to specifying this timeout valueCulley
The setQueryTimeout function is supported according to the javadoc publib.boulder.ibm.com/infocenter/iseries/v5r3/… . Maybe post a specific question with the error someone might shed more light?Saarinen

© 2022 - 2024 — McMap. All rights reserved.