Craig L Russell schrieb:
To me this means losing an important data security feature when using JDO over other access paths to the DB. FK constraints can prevent you from inadvertently deleting data, and by silently removing any dangling references on the object level (and so circumventing any FK constraints) you are entirely losing this kind of "safety belt"! JDO would never tell you about these dangling references, but instead would silently go and delete that information. As I wrote in an earlier mail, we had a case here where we were really lucky that the FK constraint would fire upon deletion, because we didn't think of all the relationships that an object would be removed from, and for which we really didn't want to lose the information. That was for users that are logged as creators and modifiers of other objects: if you can delete a user, you'll lose the information about who created or edited an object, something that would have gone lost silently forever if it wasn't for the FK constraints firing. If you look at the code in DeleteRequest, you'll see that in execute() it'll null out FKs for any fields obained using getFildsWithRelatedObjects(). The latter's javadoc says /** * All fields that have related objects and where we use the related object to * maintain a relationship. These are used where we have 1-1 bidirectional * relationships with a single FK (in the other object). * @return The fields with related objects */ public FieldMetaData[] getFieldsWithRelatedObjects() That's the case for 1-1 relationships with "mapped-by" on the side where the object is deleted. From what I saw in my tests, that's where the nulling out happens, and it doesn't happen for one-many relationships with "mapped-by", so you'll see FK constraints violations there.
|
- JDO TCK Conference Call Friday, June 23 9 am PST Michelle Caisse
- JDO TCK Conference Call Friday, June 23 9 am PST [UPDA... Michelle Caisse
- Minutes: JDO TCK Conference Call Friday, June 23 9 am ... Craig L Russell
- Re: Minutes: JDO TCK Conference Call Friday, June 23 9... Erik Bengtson
- JDO TCK Conference Call Friday, June 30 9 am PST Michelle Caisse
- Minutes: JDO TCK Conference Call Friday, June 30 9 am ... Michelle Caisse
- JDO TCK Conference Call Friday, July 14 9 am PST Michelle Caisse
- Minutes: JDO TCK Conference Call Friday, July 14 9 am ... Craig L Russell
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Jörg von Frantzius
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Craig L Russell
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Jörg von Frantzius
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Craig L Russell
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Jörg von Frantzius
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Michael Watzek
- Re: Minutes: JDO TCK Conference Call Friday, July 14 9... Bin Sun
- JDO TCK Conference Call Friday, July 21 9 am PST Michelle Caisse
- Re: JDO TCK Conference Call Friday, July 21 9 am PST Craig L Russell
- JDO TCK Conference Call Friday, July 28 9 am PST Michelle Caisse
- Minutes: JDO TCK Conference Call Friday, July 28 9 am ... Michelle Caisse
- JDO TCK Conference Call Friday, August 4, 9 am PST Michelle Caisse
- Minutes: JDO TCK Conference Call Friday, August 4, 9 a... Craig L Russell
