IBM Support

Addressing JDBC reason code XAER_OUTSIDE on DSRA0320E and J2CA0027E

Troubleshooting


Problem

Conditions under which the XAER_OUTSIDE return code might be returned to an application that is making JDBC™ calls within a transaction.

Symptom

The following error messages are logged when an EJB™ receives an XAER_OUTSIDE from the JDBC driver's resource manager:

04-04-21 9:57:33:626 KST 7e87402a WSRdbXaResour W DSRA0302E: XAException Error code is XAER_OUTSIDE. Exception is <null>

04-04-21 9:57:33:642 KST 7e87402a XATransaction E J2CA0027E: Transaction ID : {XID: formatId(57415344), gtrid_length(26), bqual_length(25), data(00000001 7114E7C3 F47D9EBD E5E6CBB7 BD3478D2 319CB352 FC2C01E7 C3F47D9E BDE5E6CB B7BD3478 D2319CB3 52FC2C2A 401545)} error occurs calling start at XA resource adapter of jdbc/zeus_xa datasource.

For DB2®, the error SQL0998N Error occurred during transaction or heuristic processing. Reason Code = reason-code Subcode = subcode is logged with reason code 8. Reason Code 8 means XAER_OUTSIDE.

Cause

This reason code (XAER_OUTSIDE) means a resource manager is doing work outside distributed transaction.

Some possible causes:

  1. Local transaction prior to starting a subsequent global (distributed) transaction operation
  2. The data source is referred to directly using JDBC without using a JDBC connection
  3. XAER_OUTSIDE means that you have an active non-XA connection to a database before an active XA connection
    In other words, the connection has been used to update the database in a local transaction, with the connection set to not auto commit or without the results being committed prior to a subsequent distributed transaction operation. When a XA Global transaction is then started it fails with this reason code, because there is work outstanding for that datasource outside of the scope of the Global tx.

Resolving The Problem


Some possible solutions are:

  1. Set autocommit to true to commit transaction results upon completion of the transaction.
  2. If the J2CA0027E message indicates the XAER_OUTSIDE occurs on a start for an XA resource, then change the application attributes to commit for an unresovled action or change application to complete the work on the connection prior to using it in another transaction.
  3. Apply any necessary DB fixes. There have been some errors in the JDBC code that can cause this reason code to be generated.

For DB2, the following APARs address problems in which the XAER_OUTSIDE reason code is being returned improperly.

    IY42313 -- (DB2 7.2) XA_PROTO is returned when XAER_OUTSIDE should be returned.
    IY46858 -- (DB2 8) XA_PROTO is returned when XAER_OUTSIDE should be returned.
    IY54743 -- XAER_OUTSIDE error is returned in spite of autocommit being turned on.
    IY55661 -- Getting XAER_OUTSIDE error going from V7 Client to OS390

For Oracle 9i, this Oracle bug might be applicable: 2516990

To diagnose the cause of an XAER_OUTSIDE reason code; use the MustGather: Java Transaction Service (JTS) problems in version 6.1, 6.0, and 5.1 document to enable the transaction-specific trace events.

If there are EJBs that are using EJB persistence, then add the event PMGR=all=enabled. Trace Specification field, type:
    If the application also uses JMS or is an MDB, then use this technote to add the JMS-specific trace events, MustGather: Java Message Service (JMS) problems (not involving Service Integration Technologies) with WebSphere Application Server


    Also request the appropriate JDBC driver traces, if applicable.

    [{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java 2 Connectivity (J2C)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0;6.1;6.0.2;5.1","Edition":"Edition Independent","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

    Document Information

    Modified date:
    15 June 2018

    UID

    swg21175904