Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 46816 invoked from network); 30 Mar 2007 07:30:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Mar 2007 07:30:26 -0000 Received: (qmail 16312 invoked by uid 500); 30 Mar 2007 07:30:31 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 16296 invoked by uid 500); 30 Mar 2007 07:30:31 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 16285 invoked by uid 99); 30 Mar 2007 07:30:31 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 00:30:31 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [193.191.216.49] (HELO IMSSOUT2.minfin.be) (193.191.216.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2007 00:30:21 -0700 Received: from finmfe3.minfin.fed.be ([10.2.31.15]) by IMSSOUT2.minfin.be with InterScan Message Security Suite; Fri, 30 Mar 2007 09:33:32 +0200 Received: from conversion-daemon.finmfe3.minfin.fed.be by finmfe3.minfin.fed.be (Sun Java System Messaging Server 6.2-1 (built Feb 24 2005)) id <0JFP00A01G7K6N00@minfin.fed.be> (original mail from ann.carpentier@guest.minfin.fed.be) for user-java@ibatis.apache.org; Fri, 30 Mar 2007 09:29:58 +0200 (CEST) Received: from BE505999 ([10.12.5.130]) by finmfe3.minfin.fed.be (Sun Java System Messaging Server 6.2-1 (built Feb 24 2005)) with ESMTP id <0JFP007Y0GTVD630@minfin.fed.be> for user-java@ibatis.apache.org; Fri, 30 Mar 2007 09:29:58 +0200 (CEST) Date: Fri, 30 Mar 2007 09:29:43 +0200 From: Ann Carpentier Subject: ignore failed record and continue the rest of records in the batch? To: user-java@ibatis.apache.org Message-id: <0JFP007Y2GTYD630@minfin.fed.be> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: multipart/alternative; boundary="Boundary_(ID_j2v4IwAO31/kOymFPcFcGw)" Thread-index: AcdynS8/8oLE8utjTJyvARiL/qXfnw== X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --Boundary_(ID_j2v4IwAO31/kOymFPcFcGw) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Hi, I've a question about the commit & rollback of the ibatis-batch. As I understood, executeBatchDetailed will still rollback all statements between startBatch and executeBatchDetailed. is that right? Is there a way to ignore the failed record (just log the failed one) and continue the rest of records in the batch? This is my code: KEtatCivilJdbcDao kEtatCivil = new KEtatCivilJdbcDao(); DAOUtil.getInstance(Constants.SQLMAP_DU).startTransaction(); DAOUtil.getInstance(Constants.SQLMAP_DU).startBatch(); KCodeVO vo = new KCodeVO(); kEtatCivil.insert(vo); kEtatCivil.insert(vo); kEtatCivil.insert(vo); kEtatCivil.insert(vo); kEtatCivil.insert(vo); // geeft een fout! kEtatCivil.insertFout(vo); kEtatCivil.insert(vo); DAOUtil.getInstance(Constants.SQLMAP_DU).executeBatch(); DAOUtil.getInstance(Constants.SQLMAP_DU).commitTransaction(); DAOUtil.getInstance(Constants.SQLMAP_DU).endTransaction(); The problem is, that when we're at the step 'executeBatch', he crashes on the commit of the insertFout (foreign key doesn't exists). The problem is, that the queries after insertFout aren't executed. Is there a way to ignore the failed record and continue with the rest of records in the batch? Thx, Ann ---------------------------------------------------------------- - Disclaimer: http://www.minfin.fgov.be/disclaimer.htm --Boundary_(ID_j2v4IwAO31/kOymFPcFcGw) Content-type: text/html; charset=us-ascii Content-transfer-encoding: 7BIT

Hi,

 

I’ve a question about the commit & rollback of the ibatis-batch.

 

As I understood, executeBatchDetailed will still rollback all statements between startBatch and executeBatchDetailed. is that right? Is there a way to ignore the failed record (just log the failed one) and continue the rest of records in the batch?

 

This is my code:

 

 

                        KEtatCivilJdbcDao kEtatCivil = new KEtatCivilJdbcDao();

     

       

        DAOUtil.getInstance(Constants.SQLMAP_DU).startTransaction();

        DAOUtil.getInstance(Constants.SQLMAP_DU).startBatch();

       

        KCodeVO vo = new KCodeVO();

        kEtatCivil.insert(vo);

        kEtatCivil.insert(vo);

        kEtatCivil.insert(vo);

        kEtatCivil.insert(vo);

        kEtatCivil.insert(vo);

       

        // geeft een fout!

        kEtatCivil.insertFout(vo);

       

        kEtatCivil.insert(vo);

       

                        DAOUtil.getInstance(Constants.SQLMAP_DU).executeBatch();

                        DAOUtil.getInstance(Constants.SQLMAP_DU).commitTransaction();

        DAOUtil.getInstance(Constants.SQLMAP_DU).endTransaction();

 

The problem is, that when we’re at the step ‘executeBatch’, he crashes on the commit of the insertFout (foreign key doesn’t exists). The problem is, that the queries after insertFout aren’t executed. Is there a way to ignore the failed record and continue with the rest of records in the batch?

 

 

Thx,

Ann



Disclaimer
--Boundary_(ID_j2v4IwAO31/kOymFPcFcGw)--