ORA-0100: Maximum open cursors exceeded
カーソルの数を変更できない場合、回避する最善の方法は何ですか?
より良い方法はありますか:
Connection connection = DriverManager.getConnection(/* Oracle Driver */);
Statement st = null;
st = connection.createStatement();
for (/* a lot of iteration with counter */) {
st.executeUpdate(insertSql);
if ( counter % 500 == 0) {
st.close();
connection.commit();
st = connection.createStatement();
}
}
カーソルを消費するメソッド呼び出し: toexecuteUpdate
または to createStatement
? それがこのカウンターを作った理由
だと思います。executeUpdate
私が取り組んでいるオラクルの場合:
select * from v$version;
結果 :
BANNER
----------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production