一、异常描述
通过DBUtilExt工具类进行实现文本大字段读取readTemCLOB的时候,报“java.sql.SQLException: 违反协议”异常,详细错误日志如下>>
java.sql.SQLException: 违反协议@b@ at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)@b@ at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)@b@ at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)@b@ at oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.java:149)@b@ at oracle.jdbc.ttc7.TTC7Protocol.setAutoCommit(TTC7Protocol.java:538)@b@ at oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java:1220)@b@ at com.xwood.engine.common.util.DBUtilExt.readTemCLOB(DBUtilExt.java:71)@b@ at com.xwood.engine.publisher.master.TinContentMapProcesserHandler.addclob(TinContentMapProcesserHandler.java:37)@b@ at com.xwood.engine.publisher.master.TinContentMapProcesserHandler.addclob(TinContentMapProcesserHandler.java:28)@b@ at com.xwood.engine.publisher.master.TinContentMapProcesserHandler.add(TinContentMapProcesserHandler.java:71)@b@ at com.xwood.engine.publisher.core.processunit.S3PEntityRedisProcessUnit.setTargetobj(S3PEntityRedisProcessUnit.java:161)@b@ at com.xwood.engine.publisher.core.processunit.S3PEntityRedisProcessUnit.run(S3PEntityRedisProcessUnit.java:71)@b@ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
二、解决办法
根据错误日志提示找到抛异常入口代码“conn2.setAutoCommit(false);”,改为true或注释掉该行,解决问题。