org.hibernate.jdbc.AbstractBatcher : exception clearing maxRows/queryTimeout

时间:2016-07-11 20:51:27

标签: sql-server tomcat

I am getting the below exception when my application tries to query MS SQL server for a functionality. Referring to other suggestions on this forum, I have already updated my tomcat configuration (context.xml) for the impacted resource to values shown below. But it didn't help. An observation on this, if the functionality is repeatedly invoked, then it works in 1 out of 4/5 attempts. Also, when it works, the specific item it fails other time is executed within 40 seconds. (Usually 36-39 seconds) However, if at all it touches the 40 seconds mark, the exception is thrown and functionality fails.

Resource Config

<Resource
    minEvictableIdleTimeMillis="60000"
    maxActive="100"
    auth="Container"
    testOnBorrow="true"
    password="*******" 
    testOnReturn="false"
    testWhileIdle="true" 
    url="jdbc:sqlserver://*****"
    maxWait="10000"
    maxIdle="30"
    name="jdbc/CiteMod"
    username="********" 
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
    type="javax.sql.DataSource"
    validationQuery="Select 1"
    timeBetweenEvictionRunsMillis="1800000">

Exception Log

15:25:15.259(07/11) WARN  org.hibernate.jdbc.AbstractBatcher : exception clearing maxRows/queryTimeout
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:388)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(SQLServerStatement.java:978)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getMaxRows(SQLServerStatement.java:1011)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.getMaxRows(DelegatingStatement.java:237)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.getMaxRows(DelegatingStatement.java:237)
        at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:298)
        at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:234)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1863)
        at org.hibernate.loader.Loader.doQuery(Loader.java:718)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
        at org.hibernate.loader.Loader.doList(Loader.java:2294)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
        at org.hibernate.loader.Loader.list(Loader.java:2167)
        at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
        at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1832)
        at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
        at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:179)
        at com.lexisnexis.citemod.metadata.service.ExportFilesService.verifyTokenizeResolutionFileName(ExportFilesService.java:594)
        at com.lexisnexis.citemod.metadata.service.ExportFilesService.verifyTokenizeResolutionFile(ExportFilesService.java:551)
        at com.lexisnexis.citemod.metadata.web.action.export.ExportFilesAction.listVerifyTokenizeResolution(ExportFilesAction.java:496)
        at sun.reflect.GeneratedMethodAccessor402.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
        at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
        at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:146)
        at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
        at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
        at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
        at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
        at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
        at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
:

0 个答案:

没有答案