Specify IBatis query timeout

你。 提交于 2019-12-07 16:48:53

问题


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

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/3866045/specify-ibatis-query-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!