<dependency>
<groupId>org.objectweb.jotm</groupId>
<artifactId>jotm</artifactId>
<version>2.1.11</version>
</dependency>
import javax.transaction.UserTransaction;
import org.objectweb.jotm.Current;
import org.objectweb.jotm.Jotm;
public class TransactionManagerExample {
public static void main(String[] args) throws Exception {
Jotm jotm = new Jotm(true, false);
UserTransaction ut = Current.getTransaction();
try {
ut.begin();
ut.commit();
} catch (Exception e) {
ut.rollback();
} finally {
jotm.stop();
}
}
}