It means that for every SQL added to the batch it will open a new cursor?
 
Thanks,
Vio Stan


From: Mike Fagan [mailto:[EMAIL PROTECTED]
Sent: Monday, November 28, 2005 12:18 PM
To: [email protected]
Subject: Re: java.sql.BatchUpdateException: ORA-01000: maximum open cursors exceeded

Vio Stan wrote:
Hello
 
I have to load, process and save arround 100,000 rows.
In order to do this I set a batch size to 1000 (can increase or decrease this value) so I process, for example 100 times x 1000 records.
So, in one operation I have to save, let say, 1000 records. In order to do this I use batches with IBatis.
 
I get the "java.sql.BatchUpdateException: ORA-01000: maximum open cursors exceeded" exception when I try to save.
 
My code is something like this
 
...................
  SqlMapClient sqlMap = MyAppSqlConfig_Output.getSqlMapInstance(); 
        try
        {
            sqlMap.startTransaction();
            sqlMap.startBatch();
....................
              // this is generated from a loop 
             { 
              sqlMap.insert("insert1", hm1);  //hm1 is a HashMap
              sqlMap.insert("insert2", hm2); 
              sqlMap.insert("insert3", hm3);  
.....................
              sqlMap.insert("insert1000", hm1000);  
              }
 
        int fromExecutebatch = sqlMap.executeBatch();
        sqlMap.commitTransaction();
     }
      catch (Exception e)
      {
           e.printStackTrace(System.out);
           log.error(e);
      }
      finally
      {   
        sqlMap.endTransaction();
        ........................
      }
 
Pls. help!
Thanks,
Vio

          
Vio,

Have your DBA look at the parameter OPEN_CURSORS. I bet this is set to a number less than 1000. If your DBA is not willing to update this value, then you will have to adjust your batch inserts not to exceed this value.

Regards,
Mike Fagan

Reply via email to