33
Views
2
Comments
[BDDFramework] BDD framework - Data gets commited when an exception is thrown
Question
bddframework
Web icon
Forge asset by OutSystems

Hi all, 


I am encountering the following problem when using the BDD Framework. I have not yet encountered this kind of behavior, so I am curious what the cause might be. I have a setup, in which multiple server actions are called. Let's say server actions 1 - 5. They are also placed in this order (first 1, then 2, etc.). When an exception is thrown at server action 3, the transactions from 1 and 2 are still commited to the database. This strikes me as weird behavior, since when the setup of a test fails, there should not be any testdata written to the database, because if a test succeeds, we have a teardown to clean up the data. So it makes sense that when the setup of a test fails (and therefore does not reach the teardown), it should rollback the transactions that are within the Setup screen action.

Kind regards,


Jori

2024-10-16 11-59-48
Nick Vandebriel

Hey Jori,

Usually this happens when the abort transaction on your exception handler is set to no like below:


If set to yes this will rollback all the changes.


Kind regards

UserImage.jpg
Jori Lam

Hi Nick, 


I already checked, mine was already set to yes.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.