Referential Integrity
Hi,
I developed a custom membership provider who can create users under conditions. And during my tests, I encounter a referential integrity problem on the database.
On datatable [sf_user_link] there is no constraints. By code with standard method's provider, I can successfully link role to non existing user...
Regards,
Nicolas
Hi Nicolas,
Indeed there are no constraints in the database. We maintain the integrity inside our code. Does the lack of such constraints interfere with the logic in your custom provider?
Greetings,Not really but it can be dangerous and totally invisible when we realize custom's development on Sitefinity.
I see it because my membership provider doesn't save the generated user in database, and link it to role in [sf_user_link].
For each development who generate sitefinity items it potentially corrupt data in our database. And we have to be sure code source works perfectly before use manager method SaveChanges().
Regards,
Nicolas
Hi Nicolas,
Usually we handle this by using transactions - this ensures the data integrity and prevents orphan records from occurring. None of the tables in our model have any restraints, everything is handled via transactions.
All the best,