Versions des environnements
Network:
Windows 2003 Server
>Hi everybody,
>
>I'm having a Catch 22 problem and I'm thinking of a best way to handle it, may be you can suggest something.
>
>In my test class we have rollback property set to true and it automatically rolls back all SQL commands.
>
>This is good as I don't want my tests to create new rows in the database.
>
>Unfortunately, for the particular case I have right now I first create parent row and then in a separate method and separate command try to create a child row.
>
>Since the original transaction was rolled back, I am getting the Foreign Key violation error and can not really test my procedure.
>
>So, what is the best way to handle this situation - I don't really want to create extra rows, but I don't want to get the SQL error either.
>
>Thanks in advance.
Hmmm . . . Maybe you all can teach me something here. I thought RI was for just this purpose. Why don't you create a cascade trigger to delete the orphan child records automatically?
Absent that, why not a simple sub tied to the parent delete method to kill off the child records either automatically or manually?
- D
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement