Start by removing the BEGIN TRAN/COMMIT statements. They serve no use here because you have no error detection.
Check your Java program... is it keeping a file open?
Get rid of the WAIT FOR... it makes a long transaction even longer.
Last but not least... if someone inserts 1000 rows and two of them have the same order number, BOOM! Code will fail because you try to put the order number into a variable which can only accept one row. This isn't like Oracle where you write a single row trigger and tell it FOR EACH ROW... all the rows you inserted are in a single INSERTED table. You will need to rewrite this trigger to be set-based instead of RBAR.
--Jeff Moden
Change is inevitable... Change for the better is not.