I'm a developer, but I turn to the dba community for the following question.
I'm writing an integration test in C#. In this test, I start a transaction first, and always rollback so nothing is committed to the database, regardless of wether the test succeeds or fails.
After starting the transaction, I insert something in a table. There is a trigger for insert on this table, but I get the impression this trigger is only triggered when I commit my transaction.
Is this true?
Is there a way for me to make the trigger fire inside the transaction?
So what happens at runtime is:
- Insert in table A
- Trigger is fired and inserts in table B
What happens in my test is:
- Open transaction
- Insert in table A
- Check table B --> insert hasn't been executed
insert
into table B via the same database connection, or a different one?