title: java.sql.SQLException: enlist: caught Exception
body: <p>In WAS7(websphere-7) --- trying to access two database using a XATransactionFunction. In one of them I am getting the error below. Both the database are under XATransactionFunction and database is XA enabled(According to our DBA). The code breaks when I try to access the prepared statement trying to run a select query.
  Databse: SQL Server 2008, Driver : sqljdbc4.0
  What Am I missing??</p>
  
  <p>Please help. </p>
  
  <p>Tried already : 
  1. Enabled LPS in application ear files , reconfigured the application to accept the heuristic risk. </p>
  
  <pre><code> String sql = createSelectSql(TABLE_WITH_SCHEMA_NAME, SINGLE_ROW_BY_VOUCHER_KEY_FIELD_NAMES);
      ps = dbConnection.prepareStatement(sql);
  
  
  [6/13/14 12:07:00:503 MDT] 00000025 RegisteredRes E   WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
  [6/13/14 12:07:00:614 MDT] 00000025 LocalTransact E   J2CA0030E: Method enlist caught com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
      at com.ibm.ws.tx.jta.RegisteredResources.enlistResource(RegisteredResources.java:864)
      at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:1788)
      at com.ibm.ws.tx.jta.TranManagerSet.enlistOnePhase(TranManagerSet.java:615)
      at com.ibm.ejs.j2c.LocalTransactionWrapper.enlist(LocalTransactionWrapper.java:593)
      at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:2231)
      at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:2519)
      at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:717)
      at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2760)
      at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2713)
      at ca.ab.gov.acs.cfm.voucher.VoucherHeader.findHeader(VoucherHeader.java:322)
  </code></pre>