I have searched for the answer to my upcoming question but can't seem to get a good answer.
I have a service layer method annotated with
This method calls several methods in my DAO which are also annotated with the same transaction statement listed above. My goal being that I want the several DAO methods to run as one unit of work (I know, the definition of a Transaction!).Code:@Transactional(readOnly = false, propagation = Propagation.REQUIRED
We had a specific problem where we were generating the same "thing" when several people pressed the submit button at the same time. My solution was to put a transaction on the service layer method as stated above.
My question is how do I unit test to ensure that this specific problem is solved. In other words, how do I validate that the spring transaction is actually "doing its job"?
Ultimately we will do an actual test with many people pressing the button at the same time but I want to verify by unit testing it first.


Reply With Quote