Otis wrote:
That would work in sqlserver 2005, but in sqlserver 2000, there's no NEWSEQUENTIALID(), so the new GUID isn't retrievable from the db.
The PK value to set is set as every other field in the entity. So I shouldn't worry at all about what happens with the value, as that's been taken care of. so you set field a, b and c to a value and the pk to a guid and you save the entity.
ok, but said, for example, that I'm saving a complex graph object:
1) I have many different entities using guid as PK
2) I recursively save the object graph
3) I generate and set the guid PK in an override of OnBeforeEntitySave method
Setting the PK will trigger the PK-FK sync.
The PK-FK sync will change data in different entities.
But if the PK-FK sync occur due to a change made in the OnBeforeEntitySave method, the update queue is already build.
Maybe that the PK-FK sync can change something in the update queue? If this can happen, I'm going to have some problem in setting the PK in the OnBeforeEntitySave method.
Do you think that I can loose some DB update due to the PK-FK sync happening when the update queue is already build?
Thanks, Max