Question transaction inside a transaction

liptonIcedTea

Well-known member
Joined
Jan 18, 2007
Messages
89
Programming Experience
1-3
Hi,

I'm doing some unit testing of my data layer.

how I'm doing this is to create a transaction whenever I begin a test, and to roll it back whenever I finish with it.

That way i can do whatever I want to the database, and it will get reverted.

The only problem I have is... some of my methods already implement transactions because they may need to call multiple queries or stored procedures.

Im unsure of how transactions work, but is it possible to make a transaction inside a transaction? So the test itself would be transaction, (which gets rolled back after the test finishes) and then there will also be one or more transaction inside the test itself?

Thanks
 
Back
Top