Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 43699 invoked from network); 21 Jun 2006 13:44:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jun 2006 13:44:54 -0000 Received: (qmail 60784 invoked by uid 500); 21 Jun 2006 13:44:33 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 60744 invoked by uid 500); 21 Jun 2006 13:44:32 -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 60714 invoked by uid 99); 21 Jun 2006 13:44:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jun 2006 06:44:32 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of torsten.michelmann@gmx.de designates 213.165.64.21 as permitted sender) Received: from [213.165.64.21] (HELO mail.gmx.net) (213.165.64.21) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 21 Jun 2006 06:44:30 -0700 Received: (qmail 25022 invoked by uid 0); 21 Jun 2006 13:44:08 -0000 Received: from 84.170.214.59 by www056.gmx.net with HTTP; Wed, 21 Jun 2006 15:44:08 +0200 (CEST) Content-Type: text/plain; charset="utf-8" Date: Wed, 21 Jun 2006 15:44:08 +0200 From: "Torsten Michelmann" In-Reply-To: <20060621064601.174350@gmx.net> Message-ID: <20060621134408.17350@gmx.net> MIME-Version: 1.0 References: <5820E7E2A928DB46824297946AC2024A9A5E74@pandore.ircm.priv> <20060621064601.174350@gmx.net> Subject: Re: Re: RE: Data not commited to DB2 To: user-java@ibatis.apache.org X-Authenticated: #30630238 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N after using SqlMapClient.getCurrentConnection() and doing the insert via native JDBC on this connection I received a SQLException that led me finally in the right direction (there was a problem with a constraint which I was not aware of). I just wonder why iBatis completely catched this exception and did not return any error that I was able to catch. I would be tempted to say that I should have used the element instead of the element (as I have seen different behaviour regarding errors when using instead of the more specialized elements), but I need the nested element which is not available inside . Is there an explanation for this behaviour? Or should I have done something different? Thanks a lot for the insight -------- Original-Nachricht -------- Datum: Wed, 21 Jun 2006 08:46:01 +0200 Von: Torsten Michelmann An: user-java@ibatis.apache.org, Christian.Poitras@ircm.qc.ca Betreff: Re: RE: Data not commited to DB2 > Hi Christian, > > you are right that the line should be in the try-catch. This is just a > leftover from my various debugging attempts. This is also true for the > commented endTransaction() call. > > Talking about the configuration problem: > Do you have an idea what kind of iBatis configuration parameter I could be > missing? > Because if I do the same thing with pure JDBC it is working. > > Thank you for your comments. > > > -------- Original-Nachricht -------- > Datum: Tue, 20 Jun 2006 14:19:20 -0400 > Von: Poitras Christian > An: user-java@ibatis.apache.org > Betreff: RE: Data not commited to DB2 > > > I believe that your code line > > Integer > > > moKey2=(Integer)myConnection.insert("createCustomerOrderBase_MenuOrder",cok); > > log.debug("createCustomerOrderBase_MenuOrder: created entry with id > > "+moKey2); > > should be in the try catch block with other inserts. > > If the other inserts does not work, then you might have the problem your > > are talking about. > > > > Also take note that code line > > myConnection.endTransaction(); > > must not be commented. > > > > Hope that helps. > > Christian > > > > -----Original Message----- > > From: Torsten Michelmann [mailto:torsten.michelmann@gmx.de] > > Sent: Tuesday, 20 June 2006 10:15 > > To: user-java@ibatis.apache.org > > Subject: Data not commited to DB2 > > > > Hi, > > > > I have a problem with insert statements on DB2 8.1 using the current > > iBatis release. > > The problem is that they are executed without error but when I query the > > DB I don't see any of the entries. > > > > I strongly assume that it is a configuration problem, but I have spend a > > couple of hours staring at the configuration and cross-checking with the > DTD > > without success. > > > > What is particulary irritating to me is the fact that the call outside > the > > transaction was persisted ONCE to the database, all further calls to the > > method did not yield any change on the table. > > The auto generated keys are incremented and iBatis returns the generated > > id's (proven by the debug statements inside my DAO code) but I just > can't > > find them on the table. > > > > Your help is highly appreciated. > > > > ***my personal DAO*** > > public class MomDAO extends BaseDAO { > > Logger log=Logger.getLogger(MomDAO.class); > > public SqlMapClient getSqlMapClient() { > > SQLMapConfigMOM t = new SQLMapConfigMOM(); > > return t.getSqlMapInstance(); > > } > > > > public CustomerOrder createCustomerOrder(final CustomerOrderKey cok) > > throws SQLException { > > SqlMapClient myConnection=getSqlMapClient(); > > Integer > > > moKey2=(Integer)myConnection.insert("createCustomerOrderBase_MenuOrder",cok); > > log.debug("createCustomerOrderBase_MenuOrder: created entry with id > > "+moKey2); > > try { > > myConnection.startTransaction(); > > //Step 1.1 > > Integer > > > moKey=(Integer)myConnection.insert("createCustomerOrderBase_MenuOrder",cok); > > log.debug("createCustomerOrderBase_MenuOrder: created entry with > id > > "+moKey); > > int newKey=moKey.intValue(); > > //Step 2 > > Object > > > custOrderId=myConnection.insert("createCustomerOrderBase_CustomerOrder",cok); > > log.debug("createCustomerOrderBase_CustomerOrder: created entry > with > > id "+(Integer)custOrderId); > > myConnection.commitTransaction(); > > } > > finally > > { > > // myConnection.endTransaction(); > > } > > > > CustomerOrder co=new CustomerOrder(); > > //TODO: load and return complete Customer Order > > return co; > > } > > } > > > > > > ***SQLMapConfig.xml*** > > > > > > > PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" > > "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> > > > > > > > cacheModelsEnabled="false" > > enhancementEnabled="true" > > errorTracingEnabled="true" > > lazyLoadingEnabled="true" > > maxRequests="32" > > maxSessions="10" > > maxTransactions="5" > > useStatementNamespaces="false" > > /> > > > > > > > > > > > > > > > > > > > > > > > > > > ***sqlMap.xml*** > > > > > > "http://ibatis.apache.org/dtd/sql-map-2.dtd"> > > > > > parameterClass="CustomerOrderKey"> > > > INSERT INTO MENU.MENUORDER > > ( SEGMENT, SAISON, MODULE_ID,IS_MOM,VERSION) > > VALUES (#collectionKey.segmentId#, #collectionKey.seasonId#, > > #moduleKey.moduleId#,0,1); > > ]]> > > > > > > > > > > > parameterClass="CustomerOrderKey"> > > > INSERT INTO MENU.CUSTOMERORDER > > ( MENUORDER_ID, CUSTOMER_ID, ORDERID) > > VALUES (#objectId#, #customerId#, #orderId#); > > ]]> > > > > > > > > > > > > > > > > > > > > > > -- > > Greetings > > Torsten > > > > Echte DSL-Flatrate dauerhaft für 0,- Euro*! > > "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl > > -- > Gruß > Torsten Michelmann > > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer -- "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail