دنبال کننده ها

۱۳۹۶ مهر ۱۲, چهارشنبه

java - SQL AFTER UPDATE and DELETE trigger fired in sequence

[ad_1]



I am facing a strange problem while working with SQL triggers.



Java Code :-
1. Updates a record in a table (Doing this to update App User, a column in database)
2. After update, delete the same record.
3. Both update and delete is part of a transaction.



Trigger :-
1. For this table, we have a trigger which inserts a entry into AUD table for INSERT, UPDATE and DELETE operation.



What is happening :-
1. When java code executes, it update the record and delete is also successful in the main table.
2. But AUD table has entry just for UPDATE and DELETE AUD entry is missing.
3. The moment, I add a sleep between update and delete java code, all works fine, entry is made into AUD table for both update and delete operation.



Please help me as I am not able find out any solution for this on internet.




[ad_2]

لینک منبع