ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: java.sql.BatchUpdateException: ORA-01000: maximum open cursors exceeded
Date Mon, 28 Nov 2005 17:29:02 GMT
Hmmm, actually, the way that code is structured, it has to be set at 1000000.

Because the statements are all different (insert1, then insert2, then
insert3...insert1000) they are not reused, but prepared
seperately...1000 times. DOH!

IMO, this is not a task that iBATIS is suited for, and something that
should be done via some sort of native database bulk-loader tool.

Larry


On 11/28/05, Mike Fagan <mfagan@tde.com> wrote:
>  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