Discussions

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

  1. Hi, I am getting following exception with WebSphere App Server Version 5.1.1.3
    "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 5.1.0.4

    suggestion are welcome

    Thanks
    Manish
  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 5.1.1.3 defect list (http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg27004936#1) does not show any fixes related to database commit issues. Support may be able help with that question, as well.


    Bill Lasley
    Versant Corp.
    http://www.versant.com
  3. Thanks Bill for Reply.
    Yes, I facing this problem in 5.1.1.3 and not in 5.1.0.4
    IBM reports that this bug was fixed in 5.1.1.3.

    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.

    Thanks
    Manish

    manish.kishore@accenture.com
  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: www.itprototype.com
  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.

    thanks

    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>(Throwable.java)
    at javax.transaction.xa.XAException.<init>(XAException.java:63)
    at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:508)
    at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.recover(WSRdbXaResourceImpl.java:672)
    at com.ibm.ws.Transaction.JTA.XARminst.recover(XARminst.java:130)
    at com.ibm.ws.Transaction.JTA.XARecoveryData.recover(XARecoveryData.java:673)
    at com.ibm.ws.Transaction.JTA.RecoveryManager.resync(RecoveryManager.java:1415)
    at com.ibm.ws.Transaction.JTA.ResyncThread.run(RecoveryManager.java:1448)

    Does anyone know the exact way to solve it?

    Thanks in Advance!

    JJ