title: Cannot call Connection.commit in distributed transaction
body: <p>I am using Weblogic 12c and I am getting the below error while committing distributed transactions in my application.</p>
  
  <p>"java.sql.SQLException: Cannot call Connection.commit in distributed transaction.  Transaction Manager will commit the resource manager when the distributed transaction is committed"</p>
  
  <p>The part of code throwing exception is:</p>
  
  <pre><code>Session sessionNew = HibernateService.getService().getSession();
  sessionNew.connection().commit(); 
  </code></pre>
  
  <p>This question has been asked several times, but the solution I am seeking is different.
  The most common solution is to disable XA transactions to resolve the issue.
  But my application contains more than resources like database, JMS etc.
  Can anyone please suggest a solution other than the one mentioned above.</p>
  
  <p>Also, I needed to understand if there is any relation between JTA transaction timeout value and the above-mentioned error.</p>
  
  <p>Thanks a lot.</p>