使用hibernate Session在Spring中使用session.doWork时出错

时间:2013-08-09 11:32:31

标签: java spring hibernate spring-orm

在调用session.doWork(funcWork)时发现错误,找到

下面的代码
public static Object executeFunction(SessionFactory sessionFactory,
        String query, Object[] in, int outTypes) throws HibernateException {
    LOG.info("DBOperations | executeFunction action initiated=" + query);
    Session session = sessionFactory.getCurrentSession();
    FunctionWorker funcWork = new FunctionWorker(in, outTypes, query);

    try {
        session.beginTransaction();
        LOG.info("DBOperations | doWork action initiated");
        session.doWork(funcWork);
        LOG.info("DBOperations | doWork action End");
        session.getTransaction().commit();
    } catch (HibernateException ex) {
        LOG.error(ex);
        session.getTransaction().rollback();
        throw ex;
    }
    return funcWork.getOutParameter();
}

但是错误引起:java.lang.StringIndexOutOfBoundsException: String index out of range: 68但是无法确定为什么它在我的系统中工作正常而在主服务器中没有。

请建议

DEBUG [org.hibernate.transaction.JDBCTransaction] (ajp--10.40.4.154-8009-4) begin
DEBUG [org.hibernate.jdbc.ConnectionManager] (ajp--10.40.4.154-8009-4) opening JDBC connection
DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ajp--10.40.4.154-8009-4) ghcm: getConnection(null, null) [8/99]
DEBUG [org.hibernate.transaction.JDBCTransaction] (ajp--10.40.4.154-8009-4) current autocommit status: true
DEBUG [org.hibernate.transaction.JDBCTransaction] (ajp--10.40.4.154-8009-4) disabling autocommit
INFO  [com.mypkg.myemailselection.db.DBOperations] (ajp--10.40.4.154-8009-4) DBOperations | doWork action initiated
WARN  [org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener] (ajp--10.40.4.154-8009-4) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener@470ac1d8[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@33d66cde connection handles=1 lastUse=1376042939641 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@e1f8aba pool internal context=SemaphoreArrayListManagedConnectionPool@7921820a[pool=ghcm]]: java.lang.StringIndexOutOfBoundsException: String index out of range: 68
    at java.lang.String.charAt(String.java:694) [rt.jar:1.6.0_24]
    at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:1138) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:1053) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleSql.getSql(OracleSql.java:310) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleSql.getSqlBytes(OracleSql.java:604) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:177) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3857) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374) [ojdbc6.jar:11.2.0.2.0]
    at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297)
    at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)
    at com.mypkg.emailselection.db.DBOperations$FunctionWorker.execute(DBOperations.java:189) [classes:]
    at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1873) [hibernate-core.jar:3.3.0.SP1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]  
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

15:39:18,200 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ajp--10.40.4.154-8009-4) ghcm: returnConnection(470ac1d8, true) [8/98]
15:39:18,201 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ajp--10.40.4.154-8009-4) Lock owned during cleanup: java.lang.Throwable: Lock owned during cleanup
    at java.lang.Thread.getStackTrace(Thread.java:1495) [rt.jar:1.6.0_24]
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.cleanup(BaseWrapperManagedConnection.java:308)
    g.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.broadcastConnectionError(BaseWrapperManagedConnection.java:592)
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.connectionError(BaseWrapperManagedConnection.java:546)
    at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1635)
    at org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1262)
    at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:408)
    at com.mypkg.db.DBOperations$FunctionWorker.execute(DBOperations.java:189) [classes:]
    at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1873) [hibernate-core.jar:3.3.0.SP1]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) [hibernate-core.jar:3.3.0.SP1]
    at $Proxy146.doWork(Unknown Source) at com.mypkg.db.DBOperations.executeFunction(DBOperations.java:150) [classes:]
    at com.mypkg.dao.EmailDAOImpl.saveEmailSelection(EmailDAOImpl.java:221) [classes:]
    at com.mypkg.service.EmailServiceImpl.saveEmailSelection(EmailServiceImpl.java:151) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at $Proxy139.saveEmailSelection(Unknown Source) at com.mypkg.controller.EmailController.saveEmailSelection(EmailController.java:211) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

15:39:18,223 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ajp--10.40.4.154-8009-4) IJ000607: ResourceException cleaning up managed connection: org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener@470ac1d8[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@33d66cde connection handles=0 lastUse=1376042939641 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@e1f8aba pool internal context=SemaphoreArrayListManagedConnectionPool@7921820a[pool=ghcm]]: javax.resource.ResourceException: Still active locks
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.cleanup(BaseWrapperManagedConnection.java:352)
    t com.mypkg.db.DBOperations$FunctionWorker.execute(DBOperations.java:189) [classes:]
    at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1873) [hibernate-core.jar:3.3.0.SP1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) [hibernate-core.jar:3.3.0.SP1]
    at $Proxy146.doWork(Unknown Source) at com.mypkg.db.DBOperations.executeFunction(DBOperations.java:150) [classes:]
    at com.mypkg.dao.EmailDAOImpl.saveEmailSelection(EmailDAOImpl.java:221) [classes:]
    at com.mypkg.service.EmailServiceImpl.saveEmailSelection(EmailServiceImpl.java:151) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) [spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) [spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) [spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

15:39:18,245 WARN  [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ajp--10.40.4.154-8009-4) Lock owned during cleanup: java.lang.Throwable: Lock owned during cleanup
    at java.lang.Thread.getStackTrace(Thread.java:1495) [rt.jar:1.6.0_24]
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.cleanup(BaseWrapperManagedConnection.java:308)
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.destroy(BaseWrapperManagedConnection.java:431)
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.doDestroy(SemaphoreArrayListManagedConnectionPool.java:798)
    at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:408)
    at com.mypkg.db.DBOperations$FunctionWorker.execute(DBOperations.java:189) [classes:]
    at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1873) [hibernate-core.jar:3.3.0.SP1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) [hibernate-core.jar:3.3.0.SP1]
    at $Proxy146.doWork(Unknown Source) at com.mypkg.db.DBOperations.executeFunction(DBOperations.java:150) [classes:]
    at com.mypkg.dao.EmailDAOImpl.saveEmailSelection(EmailDAOImpl.java:221) [classes:]
    at com.mypkg.service.EmailServiceImpl.saveEmailSelection(EmailServiceImpl.java:151) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319) [spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at $Proxy139.saveEmailSelection(Unknown Source) at com.mypkg.controller.EmailController.saveEmailSelection(EmailController.java:211) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) [spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

15:39:18,266 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ajp--10.40.4.154-8009-4) Exception destroying ManagedConnection org.jboss.jca.core.connectionmanager.listener.NoTxConnectionListener@470ac1d8[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@33d66cde connection handles=0 lastUse=1376042939641 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@e1f8aba pool internal context=SemaphoreArrayListManagedConnectionPool@7921820a[pool=ghcm]]: javax.resource.ResourceException: Still active locks
    at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.cleanup(BaseWrapperManagedConnection.java:352)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) [hibernate-core.jar:3.3.0.SP1]
    at $Proxy146.doWork(Unknown Source) at com.mypkg.db.DBOperations.executeFunction(DBOperations.java:150) [classes:]
    at com.mypkg.dao.EmailDAOImpl.saveEmailSelection(EmailDAOImpl.java:221) [classes:]
    at com.mypkg.service.EmailServiceImpl.saveEmailSelection(EmailServiceImpl.java:151) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at $Proxy139.saveEmailSelection(Unknown Source) at com.mypkg.controller.EmailController.saveEmailSelection(EmailController.java:211) [classes:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb-7.0.13.Final.jar:]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
    at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

15:39:18,287 DEBUG [org.hibernate.util.JDBCExceptionReporter] (ajp--10.40.4.154-8009-4) error executing work [???]: java.sql.SQLException: Error
    at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1643)
    at org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1262)
    at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:408)
    at com.mypkg.db.DBOperations$FunctionWorker.execute(DBOperations.java:189) [classes:]
    at org.hibernate.impl.SessionImpl.doWork(SessionImpl.java:1873) [hibernate-core.jar:3.3.0.SP1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:616) [rt.jar:1.6.0_24]
    at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) [hibernate-core.jar:3.3.0.SP1]
    at $Proxy146.doWork(Unknown Source) at com.mypkg.db.DBOperations.executeFunction(DBOperations.java:150) [classes:]
    at com.mypkg.dao.EmailDAOImpl.saveEmailSelection(EmailDAOImpl.java:221) [classes:]
    at com.mypkg.service.EmailServiceImpl.saveEmailSelection(EmailServiceImpl.java:151) [classes:]
    at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 68
    at java.lang.String.charAt(String.java:694) [rt.jar:1.6.0_24]
    at oracle.jdbc.driver.OracleSql.handleODBC(OracleSql.java:1138) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleSql.parse(OracleSql.java:1053) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleSql.getSql(OracleSql.java:310) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleSql.getSqlBytes(OracleSql.java:604) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:177) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3857) [ojdbc6.jar:11.2.0.2.0]
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374) [ojdbc6.jar:11.2.0.2.0]
    at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297)
    at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)
    ... 79 more

1 个答案:

答案 0 :(得分:0)

是。上面写的代码是DBOperations类中的代码。这是你正在寻找的代码。在本地工作正常。

   @Override
    public void execute(Connection connection) throws SQLException {   
    CallableStatement call = connection.prepareCall(query);
    call.registerOutParameter(1, outTypes);
    int cnt = 1;
    int i = 0;
    while (i < in.length)
    call.setObject(++cnt, in[i++]); 
    call.execute();                    //Line 189
    out = call.getObject(1);
}