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 batch execution
Date Wed, 15 Dec 2004 15:10:10 GMT

Hi ,  
 
        I facing a problem regarding the execution of Batch. I'm not able 
to get the number of rows updated when the batch is executed. 
        I'm currently using IBatis version 2.0.3. 
        I'm doing the following :  

        startTransaction() 
                startBatch() 
                        insert... 
                        update... 
        int rows = executeBatch() 
        commitTransaction() 
        endTransaction


                I'm getting number of rows updated = 0. But the statements 
included in the batch get executed properly.
                   When I looked into the code, I found that when the 
preparedStatement.executeBatch() is being called in the private Batch 
class contained                 in SqlExecuter, and in executeBatch method 
of this private class, following line : 
 
                        int[] rowCounts = ps.executeBatch(); 
 
                All the int array elements contain -2, which means Success 
but No. of rows updated unknown. It's not returning the number of rows 
                updated. 
 
        I looked for it on internet, and found the following something 
similar : 
                        
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=3&t=004071
 
 
        Am not able to make how to get the number of rows updated, which 
is needed in the scenario I'm working in.

        Please help for the same.

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

Notice: The information contained in this e-mail message and/or attachments to it may contain
confidential or privileged information.   If you are not the intended recipient, any dissemination,
use, review, distribution, printing or copying of the information contained in this e-mail
message and/or attachments to it are strictly prohibited.   If you have received this communication
in error, please notify us by reply e-mail or telephone and immediately and permanently delete
the message and any attachments.  Thank you
Mime
View raw message