Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 14162 invoked from network); 18 Jan 2004 21:18:03 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Jan 2004 21:18:03 -0000 Received: (qmail 87244 invoked by uid 500); 18 Jan 2004 21:17:51 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 87212 invoked by uid 500); 18 Jan 2004 21:17:51 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 87196 invoked from network); 18 Jan 2004 21:17:50 -0000 Received: from unknown (HELO web40209.mail.yahoo.com) (66.218.78.70) by daedalus.apache.org with SMTP; 18 Jan 2004 21:17:50 -0000 Message-ID: <20040118211756.58267.qmail@web40209.mail.yahoo.com> Received: from [151.203.111.58] by web40209.mail.yahoo.com via HTTP; Sun, 18 Jan 2004 13:17:56 PST Date: Sun, 18 Jan 2004 13:17:56 -0800 (PST) From: David Le Strat Subject: Re: Double Insert with OJB RC5 with M-N mapping. To: OJB Developers List In-Reply-To: <20040118202759.43278.qmail@web40209.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N For info, I found a work around to my problem. I first create the Permission I wanted to add before creating the Principal. The described problem is still an issue. Regards, David Le Strat. --- David Le Strat wrote: > Hi there, > > I am using OJB RC5 with an M-N mapping and am having > an issue with records being inserted twice (I am > using > HSQL for development). Here is the scenario: > > I have a Principal that has Permissions where > > Principal N ... M Permission > > I add a new Principal with a collection of > Permissions. In my initial test, there is only 1 > Permission in my collection. When running that > scenario, the Permission INSERT statement is > executed > twice. > > /*C1*/SET AUTOCOMMIT FALSE > INSERT INTO SECURITY_PRINCIPAL > VALUES(182,'org.apache.jetspeed.security.impl.UserPrincipalImpl','/user/testpermission','2004-01-18 > 14:41:22.956','2004-01-18 14:41:22.956') > INSERT INTO SECURITY_PERMISSION > VALUES(183,'org.apache.jetspeed.security.PortletPermission','testportlet','view, > edit, delete, minimize','2004-01-18 > 14:41:22.956','2004-01-18 14:41:22.956') > INSERT INTO SECURITY_PRINCIPAL_PERMISSION > VALUES(182,183) > INSERT INTO SECURITY_PERMISSION > VALUES(183,'org.apache.jetspeed.security.PortletPermission','testportlet','view, > edit, delete, minimize','2004-01-18 > 14:41:22.956','2004-01-18 14:41:22.956') > COMMIT > SET AUTOCOMMIT TRUE > > I had an integrity constraint on > SECURITY_PERMISSION, > but removed it to confirm that the insert was > executed > twice. > > I enclosed schema, repository definition, some code > sample and the logs of what's happening. > > Looking at the logs, I can see 2: > [main] DEBUG > org.apache.ojb.broker.accesslayer.JdbcAccessImpl - > executeInsert : > org.apache.jetspeed.security.om.impl.PermissionImpl > > I would appreciate some advice on how to work around > this behavior. > > Regards, > > David Le Strat. > > __________________________________ > Do you Yahoo!? > Yahoo! Hotjobs: Enter the "Signing Bonus" > Sweepstakes > http://hotjobs.sweepstakes.yahoo.com/signingbonus > ATTACHMENT part 2 application/x-zip-compressed name=M-NIssue.zip > --------------------------------------------------------------------- > To unsubscribe, e-mail: > ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org __________________________________ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org