We have a J2SE application (we deploy it as a standalone JAR) which is a Jetty-powered web service, making use of JPA (EclipseLink) and JTA (Bitronix, UserTransaction). As you can guess, the main purpose of this app is to receive REST requests, process, store and provide data to the http clients.
While processing a request, sometimes we generate files on the fs. Sadly, this process is out of the scope of our JTA configuration. I have a task to bind file generation to the JTA transaction, eg. upon utx.rollback() I have to rollback file processing, and upon succesfull utx.commit() I have to commit the fs changes, too.
My senior advised me to use XADisk ( http://xadisk.java.net/ ). Seems very promising! I did some example-reading but I’m still a bit confused on how to introduce this into our app.
So my question: can anyone provide me some guidelines on how to implement this lib into a JTA application? Thanks!
Going forward on docs hunting, I found some bits of info:
Tracking issue
XADisk User Guide
The latter contains a chapter titled “Enlisting XADisk into JTA Transactions”