使用nutzdao和druid结合做数据操作时最近遇到一个怪问题,代码片段如下
Trans.begin();
Connection conn = Trans.getConnectionAuto(dao.getDataSource());
CallableStatement cs = conn.prepareCall("?=call function(?,?)", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
cs.registerOutParameter(1, java.sql.Types.INTEGER);
for (int i = 0; i < params.length; i++)
cs.setObject(i + 2, params[i]);
cs.execute();
偶尔会出现 java.lang.ArrayIndexOutOfBoundsException: null 这个异常 ,堆栈如下
java.lang.ArrayIndexOutOfBoundsException: null
at java.util.ArrayList.add(ArrayList.java:474) ~[?:1.8.0]
at com.alibaba.druid.pool.DruidPooledConnection.transactionRecord(DruidPooledConnection.java:730) ~[druid-1.1.20.jar:1.1.20]
at com.alibaba.druid.pool.DruidPooledStatement.transactionRecord(DruidPooledStatement.java:285) ~[druid-1.1.20.jar:1.1.20]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:491) ~[druid-1.1.20.jar:1.1.20]
能是哪的问题呢, 现象还不能重现。