Batch insert using iBatis

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Batch insert using iBatis

sweta n
Hi,

I get the following exception when trying to insert records using the batch concept in ibatis.I get this error after processing around 1500 records which are inserted into DB before this exception is fired.

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

i am using the following code:

try{
            SqlMapClient sqlMap = getSqlMap();
            sqlMap.startTransaction();
            sqlMap.startBatch();
             //execute insert statements here -- around 100000 records
            sqlMap.executeBatch();
            sqlMap.commitTransaction();
     }
      catch (Exception e)
      {
           e.printStackTrace(System.out);
           log.error(e);
      }
      finally
      {    
        sqlMap.endTransaction();
        ........................
      }

Could you let me know why i am facing this issue?
Loading...