one phase capable resource with existing two phase capable


EJB programming & troubleshooting: one phase capable resource with existing two phase capable

  1. Hi, I am getting following exception with WebSphere App Server Version
    "An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred."
    Interestngly this is not happening with older version WepSphere Application server

    suggestion are welcome

  2. WTRN0063E: An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred.
    Explanation: The transaction service has refused an attempt to commit a one phase capable resource with a transaction already involving other two phase capable resources. Either Last Participant Support (LPS) is not available, or if LPS is available, the application does not accept the heuristic risk that this would involve.
    User Response: Ensure that one and two phase capable resources are not involved in the same transaction, or if LPS is available, reconfigure the application to accept the heuristic risk that this would involve.

    I think LPS is only available in WBI-SF with WAS 5.1 (i.e. not available if you are using WAS 5.1 base or WAS 5.1 ND), so it looks like you will need to make a code change, if WAS support can not help you through it.

    Not sure why your code worked in previous releases, but does not work now. A quick look at the defect list ( does not show any fixes related to database commit issues. Support may be able help with that question, as well.

    Bill Lasley
    Versant Corp.
  3. Thanks Bill for Reply.
    Yes, I facing this problem in and not in
    IBM reports that this bug was fixed in

    I am not sure whether LPS is available in the server.
    You told that we can 'reconfigure the application to accept the heuristic risk'.

    How can i make changes in code to accept heuristic risk.


    [email protected]
  4. XA exception[ Go to top ]

    Note that any time you do multiple getConnection() calls using a resource reference that specifies res-sharing-scope=Unshareable , then you get multiple physical connections. This situation also occurs when res-sharing-scope=Shareable, but the sharing rules are broken. In either case, if you run in a global transaction, ensure the resources involved are enabled for two-phase commit (also sometimes referred to as JTA Enabled). Failure to do so results in an XA exception that logs the following message:
  5. hello all, i think i faced the same problem as you; i am using websphere 5.0.0, installed using default setting. may be there is a need for extra addon-installation. can you kindly guide me, i am new to websphere. thanks.

    i am trying to do a multiple Data Sources lookup and stored in a Map (eg. databases db2004, db2003, db2002, etc.). by default, my program will get connection at db2004, then search the record. if record found, return a ResultSet, else it will loop to the next Data Source in the Map until the end.

    i got the following Exceptions:
    E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
    E J2CA0030E: Method enlist caught java.lang.IllegalStateException
     while trying to enlist resources from datasource jdbc/IIMS2004 with the Transaction Manager for the current transaction, and threw a Exception.

    this exception occurred at this line
    preparedStatement = con.prepareStatement(lStrQuery);

    i checked i added the relevant EJB Resource References it, as well as in the Data Source entry in the server, i am using Websphere Developer Edition 5.0.0.


    regards, hlchan.
  6. WAS 5.0[ Go to top ]

    Have you been able to get it working in WAS 5.0?
  7. I am facing the same problem too.

    I tried switch jdbc driver class to oracle.jdbc.xa.client.OracleXADataSource.

    it works for my application for a while but it gives server side error.

    recoveryClasspath = D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/rsadapter.rar
    . The error code was XAER_RMERR. The exception stack trace follows: javax.transaction.xa.XAException
    at java.lang.Throwable.<init>(
    at javax.transaction.xa.XAException.<init>(
    at oracle.jdbc.xa.OracleXAResource.recover(

    Does anyone know the exact way to solve it?

    Thanks in Advance!