首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

关于infomix下setQueryTimeOut的有关问题

2013-03-27 
关于infomix下setQueryTimeOut的问题这个问题困扰了我好长时间。问题就出在setQueryTimeout上,这已经验证过

关于infomix下setQueryTimeOut的问题
这个问题困扰了我好长时间。
问题就出在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());
    }
  }
}


这不加又不行,加了又报错,还查不到。郁闷了好几天了都。
不知道各位再用的时候碰到过啊,碰到过的烦请告诉我一声。
[解决办法]
可以尝试设置久点。

热点排行