db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Le Strat <dlest...@yahoo.com>
Subject Double Insert with OJB RC5 with M-N mapping.
Date Sun, 18 Jan 2004 20:27:59 GMT
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
Mime
View raw message