这个问题困扰了我好长时间。
问题就出在setQueryTimeout上,这已经验证过了。
只要执行SQL会有一定的几率报:
Exception in thread "Timer-13" java.lang.Error: -79865:'Statement' already closed.
at com.informix.jdbc.IfxCancelQueryImpl.run(IfxCancelQueryImpl.java:60)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
我去查看下源码,
源码如下:
class IfxCancelQueryImpl extends TimerTask
implements IfmxCancelQuery
{
IfxStatement stmt;
Timer t = null;
public void startCancel(IfxStatement paramIfxStatement, int paramInt)
throws Exception
{
this.stmt = paramIfxStatement;
this.t = new Timer(true);
this.t.schedule(this, paramInt * 1000);
}
public void run()
{
try
{
this.stmt.cancel();
this.t.cancel();
}
catch (SQLException localSQLException)
{
this.t.cancel();
throw new Error(localSQLException.getErrorCode() + ":" + localSQLException.getMessage());
}
}
}
。
这不加又不行,加了又报错,还查不到。郁闷了好几天了都。
不知道各位再用的时候碰到过啊,碰到过的烦请告诉我一声。
------解决方案--------------------
可以尝试设置久点。