I am trying to find some examples of how I might use JTA to solve a programming problem. I need the ability to wrap a transaction around two distinct events: a File write and a SQL transaction. I have a file that needs to be copied to a particular place and a corresponding SQL update statement to be executed. If either fails, I need to be able to rollback both events.
I have tried to use the free Astrel IO Atomic, but it appears to be buggy. The Apache Transaction package almost works, but it only support File IO on the same drive. I was hoping that I could find some examples on how I might implement my own transaction.