• I am going to guess that the [font="Courier New"]WAITFOR DELAY[/font] is only there to make testing this case easier (I have done this before) and is not normally there.

    I am further going to guess that the Java programs are requerying the table in a way that is locking out the second INSERT or its trigger or its Java program. Somewhere in there the circuit close and a deadlock ensues.

    I recommend what others here have said: 1) don't call a program from a trigger (use Service Broker to shunt this work off asynchronously if necessary) and 2) don't forget that SQL Server Triggers fire per-statement, NOT per-row as in other databases.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]