title: ARJUNA012140: Adding multiple last resources is disallowed
body: <p>I have 2 data source and in a method, I need to write and read from the 2 databases. The database is PostgreSQL and my EAR app runs on wildfly-16.</p>
  
  <p><strong>I can't use 2 database connection in the same method</strong></p>
  
  <p>Ok, I know that because the system can't manage a transaction across the different database.</p>
  
  <p>So I splitted the methods in my ejb :</p>
  
  <pre><code>@TransactionAttribute(TransactionAttributeType.NEVER)
  public Response mainMethod(String parameter) {
     method1();
     method2()
  }
  
  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  private void method1(){
      ...write on database 1...
  }
  
  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  private void method2(){
      ...write on database 2...
  }
  </code></pre>
  
  <p>Why am I still getting the same error? Aren't the calls managed by two different transactions?</p>
  
  <pre><code>ARJUNA012140: Adding multiple last resources is disallowed. 
  Trying to add LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@594d9ba8[connectionListener=677e78 connectionManager=2a095926 warned=false currentXid=&lt; formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffc0a86e69:-9dc6f57:5d08b51e:f58, node_name=1, branch_uid=0:ffffc0a86e69:-9dc6f57:5d08b51e:f8a, subordinatenodename=null, eis_name=java:/jboss/datasource/db1 &gt; productName=PostgreSQL productVersion=10.8 (Ubuntu 10.8-0ubuntu0.18.04.1) jndiName=java:/jboss/datasource/db1])), 
  but already have LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@39fc2dc2[connectionListener=3724f31c connectionManager=39a995fb warned=false currentXid=&lt; formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffc0a86e69:-9dc6f57:5d08b51e:f58, node_name=1, branch_uid=0:ffffc0a86e69:-9dc6f57:5d08b51e:f64, subordinatenodename=null, eis_name=java:/jboss/datasource/db2 &gt; productName=PostgreSQL productVersion=10.8 (Ubuntu 10.8-0ubuntu0.18.04.1) jndiName=java:/jboss/datasource/db2]))
  </code></pre>