title: JTA Transaction Timeout Troubleshooting
body: <p>Setup:</p>
  <ul>
  <li>Oracle 12 DB</li>
  <li>JBoss EAP7</li>
  <li>Webservice running on JBoss, inserts into DB</li>
  <li>Batchprogramm calling the webservice from multiple threads about 130.000 times in the span of an hour</li>
  </ul>
  <p>The problem:</p>
  <blockquote>
  <p>2018-04-26 18:20:44,675 +0200 [WARN ] [com.arjuna.ats.arjuna] (Transaction Reaper) ARJUNA012117: TransactionReaper::check timeout for TX 0:ffffac110923:-4c44ed1d:5ac9329e:6866ea in state  RUN</p>
  <p>2018-04-26 18:20:44,675 +0200 [WARN ] [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012095: Abort of action id 0:ffffac110923:-4c44ed1d:5ac9329e:6866ea invoked while multiple threads active within it.</p>
  <p>2018-04-26 18:20:44,679 +0200 [WARN ] [com.arjuna.ats.arjuna] (Transaction Reaper Worker 0) ARJUNA012381: Action id 0:ffffac110923:-4c44ed1d:5ac9329e:6866ea completed with multiple threads - thread default task-48 was in progress with xxx.BaseEntity.getNextValue(BaseEntity.java:28)</p>
  </blockquote>
  <p>This happens routinely in the production environment under heavy load, not when processing fewer records and not in an identical test environment with the exact same load.</p>
  <p>The last line shows that this transaction timeout (300s) occurs while fetching the next value from a sequence:</p>
  <pre><code>CREATE SEQUENCE &quot;XXX_S&quot;  MINVALUE xxx MAXVALUE xxx INCREMENT BY 1 START WITH xxx CACHE 2 NOORDER  NOCYCLE  NOPARTITION ;
  </code></pre>
  <p>I know Oracle needs to lock/unlock the sequence in order to keep it consistent, so my parallel webservice calls must somehow run into a deadlock or massive contention, producing the timeout.</p>
  <p>How do I find the root of this problem? Which parameters can I try to manipulate?</p>