共1589条数据,只插入298条,报错:java.sql.SQLException: ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01000: 超出打开游标的最大数
ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01000: 超出打开游标的最大数
ORA-00604: 递归 SQL 级别 1 出现错误
ORA-01000: 超出打开游标的最大数                                               Connection conNew = super.getCurrentSession().connection();
PreparedStatement updateSales = null;
PreparedStatement updateSales1 = null;
for(int i = 0; i < list.size(); i++) {
                                                               updateSales = conNew.prepareStatement(insTabsql.toString());

updateSales.setString(1, tid);
updateSales.setString(2, tableVal.getCODEVALUE());
updateSales.setString(3, tableVal.getCODENAME());
updateSales.setString(4, zySjzyUserPojo.getUserid());

updateSales.executeUpdate();
updateSales.close();
                                                         List<TableColumn> listColumn = JdbcUtils.getColumns(tableVal.getCODEVALUE(), con);
                                                        for(int j = 0; j < listColumn.size(); j++) {
                                                                                     updateSales1 = conNew.prepareStatement(insTabColsql.toString());

updateSales1.setString(1, UUID.randomUUID().toString());
updateSales1.setString(2, tableColVal.getName());
updateSales1.setString(3, tableColVal.getCommen());
updateSales1.setString(4, tid);
updateSales1.setString(5, tableColVal.getType());
updateSales1.setInt(6, tableColVal.getLength());

updateSales1.executeUpdate();
updateSales1.close();
             }
}

解决方案 »

  1.   

    show parameters open_cursors
    看看这个参数设置的多少。默认是300
    游标使用完了记得关闭。
    如果实在不能关,那就增大游标数
    alter system set open_cursors=2000 scope=both;
      

  2.   

    我之前已经增大了游标数了
    SQL> show parameters open_cursorsNAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    open_cursors                         integer     65535