ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohit.vo...@tcs.com
Subject Problem in executing a batch
Date Mon, 22 Nov 2004 09:16:22 GMT

Hi, 
 
I'm currently using IBatis version 2.0.3. I'm not able to work upon with 
Batch. I'm doing the following : 
 
sqlMap.startBatch(); 
sqlMap.insert(....); 
sqlMap.update(....); 
int rows = sqlMap.executeBatch(); 
System.out.println("Number of rows affected = "+rows); 
 
And it is always showing 0. 
 
I debugged and found that when executeBatch is being executed, following 
code snippet 

   public int executeBatch(SessionScope session)
      throws SQLException {
    int rows = 0;
    Batch batch = (Batch) session.getBatch();
    if (batch != null) {
      try {
        rows = batch.executeBatch();
      } finally {
        batch.cleanupBatch();
      }
    }
    return rows;
  } 


        in SqlExecuter,  batch = (Batch) session.getBatch() always returns 
null. Please help me out with this.

Thanks,

Rohit Vohra
Tata Consultancy Services Limited
C - 56, Phase 2
Noida,Uttar Pradesh
India
Mailto: rohit.vohra@tcs.com
Website: http://www.tcs.com

DISCLAIMER: The information contained in this message is intended only and solely for the
addressed individual or entity indicated in this message and for the exclusive use of the
said addressed individual or entity indicated in this message (or responsible for delivery
of the message to such person) and may contain legally privileged and confidential information
belonging to Tata Consultancy Services Limited. It must not be printed, read, copied, disclosed,
forwarded, distributed or used (in whatsoever manner) by any person other than the addressee.
Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful
act and can possibly attract legal action, civil and/or criminal. The contents of this message
need not necessarily reflect or endorse the views of Tata Consultancy Services limited on
any subject matter.
  Any action taken or omitted to be taken based on this message is entirely at your risk and
neither the originator of this message nor Tata Consultancy Services Limited takes any responsibility
or liability towards the same. Opinions, conclusions and any other information contained in
this message that do not relate to the official business of Tata Consultancy Services limited
shall be understood as neither given nor endorsed by Tata Consultancy Services Limited or
any affiliate of Tata Consultancy Services Limited. If you have received this message in error,
 you should destroy this message and may please notify the sender by e-mail. 
 Thank you.
Mime
View raw message