@@ -0,0 +1,1393 @@
+package jodd.jtx;%0A%0Aimport jodd.jtx.fixtures.WorkResourceManager;%0Aimport jodd.jtx.fixtures.WorkSession;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport java.util.concurrent.CountDownLatch;%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.ThreadPoolExecutor;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static jodd.jtx.JtxPropagationBehavior.*;%0Aimport static org.junit.jupiter.api.Assertions.fail;%0A%0Aclass JtxThreadTest %7B%0A%0A%09@Test%0A%09void testMultithreadsAndJtx() %7B%0A%09%09JtxTransactionManager jtxm = createManager();%0A%0A%09%09ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(100);%0A%09%09CountDownLatch latch = new CountDownLatch(10000);%0A%0A%09%09for (int i = 0; i %3C 10000; i++) %7B%0A%09%09%09executor.execute(() -%3E %7B%0A%09%09%09%09JtxTransaction jtx = askForTx(jtxm);%0A%09%09%09%09WorkSession work = jtx.requestResource(WorkSession.class);%0A%0A%09%09%09%09work.writeValue(%22X%22);%0A%0A%09%09%09%09jtx.commit();%0A%09%09%09%09latch.countDown();%0A%09%09%09%7D);%0A%09%09%7D%0A%0A%09%09try %7B%0A%09%09%09latch.await(5, TimeUnit.SECONDS);%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09fail(e);%0A%09%09%7D%0A%09%09jtxm.close();%0A%09%7D%0A%0A%0A%09private JtxTransactionManager createManager() %7B%0A%09%09JtxTransactionManager jtxManager = new JtxTransactionManager();%0A%09%09jtxManager.registerResourceManager(new WorkResourceManager());%0A%09%09return jtxManager;%0A%09%7D%0A%0A%09private JtxTransaction askForTx(JtxTransactionManager jtxm) %7B%0A%09%09return jtxm.requestTransaction(new JtxTransactionMode(PROPAGATION_REQUIRED, false));%0A%09%7D%0A%7D%0A

Test added.