Here is what I am doing in one transaction.
1. insert/update on table A
2. a trigger on table A inserts/updates table B , obviously no
java code for this , done automatically.
3. insert on table C.
My requirement is to make sure the correct order of insert/update in DB as I have mentioned above.
But I believe(and I am not sure) trigger will only be called once the transaction is complete i.e. after step 3 is done. In this case the order will be 1 , 3 , 2 .
How can I make the trigger called before doing the step 3?
Please suggest.
My attempt : I wrote a line
just before the DAO layer of step 3. But it didnt work. Also I saw the order 1,3,2 is also not guaranteed as on some machine I am getting the correct order as 1,2, 3 without any change on one machine. Does it also have anything to do with server or db version?
My requirement is to achieve a guaranteed order of 1,2, 3.
Thanks a lot in advance.