There is only one after update trigger on a table that contains production order details. The Quantity Produced column in this table will be updated from various shop floor locations (HMI). Do multiple triggers can be fired. There is no trigger getting called within a trigger.
Within the trigger we first save the production order number in a temporary table and then call a java program using xp_cmdshell for the Production order being updated and then do the confirmation in SAP for all the orders in the temporary table.
Now when we update 2 different production orders from different systems, the triggers get fired... but the result says that only the first triggers caused the successful execution of calling a java program. The other one didnt executed...
[color=#FF0000]Transaction (Process ID 53) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.[/color]
Only the first trigger gets executed properly, the second doent execute
Following is the code that we have used in the trigger...
WAITFOR DELAY '00:00:01'
--Retrieve updated Quantity
--Insert Updated values in temporary table
INSERT INTO T_CONFIRMED_ORDERS VALUES(@orderNumber,GETDATE(),'SETConnector',GETDATE(),null,null,null);
PRINT 'CALLING JAVA PROGRAM'
--call JAVA program
SET @cmd='java -cp C:\TCS\SETConnector\JavaTest;C:\TCS\SETConnector\SQLJDBC\sqljdbc.jar;C:\TCS\SETConnector\jco\jar\sapjco.jar; OrderConfirmation';
EXEC xp_cmdshell @cmd