title: How to enable custom isolation levels for a JTA Transaction Manager in Spring
body: <p><strong>Question</strong></p>
  
  <p>How do I configure a <em>JtaTransactionManager</em> object with <em>allowCustomIsolationLevels</em> set to <em>true</em> via Spring such that the Spring configuration can be used across multiple application servers?</p>
  
  <p><strong>Background:</strong></p>
  
  <p>I have an application that is currently running out of JBossAS and I'm trying to get it to run in WebSphere. The only issue I'm currently having is getting the correct JTA Transaction Manager injected with the proper settings.</p>
  
  <p>Here's the old setting</p>
  
  <pre><code>&lt;bean id="transactionManager"
      class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
      &lt;property name="transactionManagerName"&gt;
          &lt;value&gt;java:/TransactionManager&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="allowCustomIsolationLevels" value="true" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>This worked since JBossAS has it's JTA Transaction Manager defined at JNDI location  <em>java:/TransactionManager</em>. However, WebSphere does not have the same JNDI location.</p>
  
  <p>Spring 2.5.x provides a way to get the JTA Transaction Manager in a generalized way.</p>
  
  <pre><code>&lt;tx:jta-transaction-manager /&gt;
  </code></pre>
  
  <p>This gets the <em>JtaTransactionManager</em> object and defines it as a bean with the id <em>transactionManager</em>.</p>
  
  <p>I looked in the <a href="http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" rel="noreferrer">Spring TX schema</a>, but the only setting available is to set a specific isolation level, but not just to allow custom levels to be used (as defined elsewhere). <strong>How do I set the <em>allowCustomIsolationLevels</em> property using the <em>tx:jta-transaction-manager</em> tag?</strong></p>