ibatis执行sybase存储过程报错Stored procedure 'proc_acctquery' may be run only in unchained transaction mode

ibatis执行sybase存储过程时报错 Stored procedure 'proc_acctquery' may be run only in unchained transaction mode


Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Stored procedure 'proc_acctquery' may be run only in unchained transaction mode. 
       The 'SET CHAINED OFF' command will cause the current session to use unchained transaction mode.

	at com.sybase.jdbc3.tds.Tds.processEed(Tds.java:2988)
	at com.sybase.jdbc3.tds.Tds.nextResult(Tds.java:2292)
	at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:220)
	at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:203)
	at com.sybase.jdbc3.jdbc.SybStatement.executeLoop(SybStatement.java:1868)
	at com.sybase.jdbc3.jdbc.SybCallableStatement.execute(SybCallableStatement.java:157)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
	at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:62)
	at sun.proxy.$Proxy2.execute(Unknown Source)
	at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:278)
	at com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:39)
	at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)

解决方法 :在sybase数据库中执行  exec 'sp_procxmode  proc_acctquery' ,  'anymode'

proc_acctquery --自己编写的存储过程名

'anymode'--模式

你可能感兴趣的:(java报错总结)