db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: Double Insert with OJB RC5 with M-N mapping.
Date Mon, 19 Jan 2004 08:33:09 GMT
hi david,

does this problem still exist in the latest from cvs ? imo i've commited a fix 
for it.

jakob

David Le Strat wrote:
> 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 <dlestrat@yahoo.com> 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
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message