ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Fagan <mfa...@tde.com>
Subject Re: java.sql.BatchUpdateException: ORA-01000: maximum open cursors exceeded
Date Mon, 28 Nov 2005 17:17:34 GMT
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

Mime
View raw message