IBM Support

PI05554: EJB TIMEOUT METHOD RUNS IN A SEPARATE TRANSACTION FROM THE SCHEDULER TASK

Fixes are available

8.5.5.2: WebSphere Application Server V8.5.5 Fix Pack 2
7.0.0.33: WebSphere Application Server V7.0 Fix Pack 33
8.0.0.9: WebSphere Application Server V8.0 Fix Pack 9
8.5.5.3: WebSphere Application Server V8.5.5 Fix Pack 3
7.0.0.35: WebSphere Application Server V7.0 Fix Pack 35
8.5.5.4: WebSphere Application Server V8.5.5 Fix Pack 4
8.0.0.10: WebSphere Application Server V8.0 Fix Pack 10
7.0.0.37: WebSphere Application Server V7.0 Fix Pack 37
8.5.5.5: WebSphere Application Server V8.5.5 Fix Pack 5
8.5.5.6: WebSphere Application Server V8.5.5 Fix Pack 6
8.0.0.11: WebSphere Application Server V8.0 Fix Pack 11
8.5.5.7: WebSphere Application Server V8.5.5 Fix Pack 7
7.0.0.39: WebSphere Application Server V7.0 Fix Pack 39
8.5.5.8: WebSphere Application Server V8.5.5 Fix Pack 8
8.0.0.12: WebSphere Application Server V8.0 Fix Pack 12
8.5.5.9: WebSphere Application Server V8.5.5 Fix Pack 9
7.0.0.41: WebSphere Application Server V7.0 Fix Pack 41
8.5.5.10: WebSphere Application Server V8.5.5 Fix Pack 10
8.5.5.11: WebSphere Application Server V8.5.5 Fix Pack 11
8.0.0.13: WebSphere Application Server V8.0 Fix Pack 13
7.0.0.43: WebSphere Application Server V7.0 Fix Pack 43
8.5.5.12: WebSphere Application Server V8.5.5 Fix Pack 12
8.0.0.14: WebSphere Application Server V8.0 Fix Pack 14
8.5.5.13: WebSphere Application Server V8.5.5 Fix Pack 13
7.0.0.45: WebSphere Application Server V7.0 Fix Pack 45
8.0.0.15: WebSphere Application Server V8.0 Fix Pack 15
7.0.0.45: Java SDK 1.6 SR16 FP60 Cumulative Fix for WebSphere Application Server
7.0.0.35: Java SDK 1.6 SR16 FP1 Cumulative Fix for WebSphere Application Server
7.0.0.37: Java SDK 1.6 SR16 FP3 Cumulative Fix for WebSphere Application Server
7.0.0.39: Java SDK 1.6 SR16 FP7 Cumulative Fix for WebSphere Application Server
7.0.0.41: Java SDK 1.6 SR16 FP20 Cumulative Fix for WebSphere Application Server
7.0.0.43: Java SDK 1.6 SR16 FP41 Cumulative Fix for WebSphere Application Server
8.5.5.14: WebSphere Application Server V8.5.5 Fix Pack 14

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • EJB timeout methods are committed in a separate transaction from
    the scheduler, which means EJB timeout database updates are
    committed even if scheduler database updates are rolled back.
    If the scheduler fails over the EJB timeout method, then the EJB
     timeout database updates can be run multiple times
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  IBM WebSphere Application Server users of   *
    *                  Enterprise Java Bean (EJB) timers           *
    ****************************************************************
    * PROBLEM DESCRIPTION: EJB timer transaction handling is       *
    *                      incorrect                               *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    Prior to EJB 3, only the RequiresNew transaction attribute
    could be used for the timeout callback method, and if no
    transaction attribute was specified, RequiresNew was used.
    Internally, EJB container translated the RequiresNew
    transaction attribute to the Required transaction attribute,
    which caused EJB container to use the scheduler QOS_ONLYONCE
    setting and to reuse the global transaction started by
    scheduler.  Additionally, the EJB container translated the
    Required transaction attribute to the RequiresNew transaction
    attribute for error reporting purposes.
    In EJB 3, the EJB container was updated to allow either the
    Required or RequiresNew, so the logic to set RequiresNew by
    default was removed, but the logic to translate Required to
    RequiresNew was not removed.  Consequently, the EJB container
    internally uses the scheduler QOS_ATLEASTONCE setting, which
    causes the timeout callback methods to run in a separate
    transaction from the updates to the timer database.  This
    means the global transaction of the timeout callback method
    can succeed even though the update to the timer database
    fails.  This can cause the timeout callback logic to be
    run and committed twice unexpectedly if a timer database error
    occurs or scheduler "failover" occurs.
    

Problem conclusion

  • The EJB container has been adjusted so that the QOS_ONLYONCE
    setting is used if no transaction attribute or the Required
    transaction attribute is specified on the timeout callback
    method.  This was always the intended design and was the
    behavior prior to the changes made for EJB 3.
    
    However, because the timeout callback method is not run
    within the same global transaction as the updates to the
    timer database made by the scheduler before and after the
    timeout callback method is run, the timer row in the
    database will be exclusively locked for the duration of the
    timeout callback method.  This has the potential to cause
    database hangs or deadlocks if the application also uses the
    javax.ejb.TimerService.getTimers() method, which attempts to
    obtain a shared lock on all timer rows.  For example:
    - If the timeout callback method uses the getTimers method
      and multiple timeout callback methods run concurrently, a
      database deadlock can occur.
    - If the timeout callback method is long-running, other
      calls to getTimers in the application will appear to hang
      until the timeout callback method completes.
    
    Since applications might observe side effects, a JVM system
    property can be specified to revert to the behavior prior to
    this fix, but it is strongly recommended that it only be used
    temporarily until application changes can be made to adjust to
    the new behavior.  Use the following instructions to enable
    the property:
    
    1. Open the administrative console.
    2. Select Servers -> Server Types -> WebSphere application
    servers.
    3. Select the server you want to configure.
    4. In the Server Infrastructure area, select Java and Process
    Management -> Process definition.
    5. In the Server Infrastructure area, select Process Definition.
    6. In the Additional Properties area, select Java Virtual
    Machine.
    7. In the Additional Properties area, select Custom Properties.
    8. Select the New box.
    9. In the Name entry field, type:
    com.ibm.websphere.ejbcontainer.timerQOSAtLeastOnceForRequired
    10. In the Value entry field, type: true
    NOTE: If this setting is needed, it is strongly recommended
          that it only be used temporarily until application
          changes can be made to adjust to the new behavior.
    11. Select OK.
    12. Restart the server.
    
    The fix for this APAR is currently targeted for inclusion in
    fix packs 7.0.0.33, 8.0.0.9, and 8.5.5.2.  Please refer to the
    Recommended Updates page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI05554

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    850

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-11-05

  • Closed date

    2013-12-09

  • Last modified date

    2013-12-09

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R700 PSY

       UP

  • R800 PSY

       UP

  • R850 PSY

       UP



Document information

More support for: WebSphere Application Server
General

Software version: 850

Reference #: PI05554

Modified date: 09 December 2013