IBM Support

PI46699: A NULL VALUE IS RETURNED WHEN TRYING TO USE OPENJPA'S DELEGATINGCONNECTION'S UNWRAP()

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • You may get a null value when trying to use OpenJPA's
    DelegatingConnection's unwrap() implementation.
    
    Looking at the contract for java.sql.Wrapper, which Connection
    implements, states:
    
    Returns an object that implements the given interface to allow
    access to non-standard methods, or standard methods not exposed
    by the proxy. If the receiver implements the interface then the
    result is the receiver or a proxy for the receiver. If the
    receiver is a wrapper and the wrapped object implements the
    interface then the result is the wrapped object or a proxy for
    the wrapped object. Otherwise return the the result of calling
    unwrap recursively on the wrapped object or a proxy for that
    result. If the receiver is not a wrapper and does not implement
    the interface, then an SQLException is thrown.
    
    OpenJPA's DelegatingConnection's unwrap() implementation checks
    if the type passed as the unwrap call's argument is
    type-compatible with the delegate, and if so, returns the
    Delegate - that part is consistent with the contract.  What's
    not consistent is when the delegate is not type-compatible with
    the argument - right now it returns null, when instead, as a
    wrapper object, it should be calling the delegate's unwrap()
    method and returning the result of that.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Profile                      *
    ****************************************************************
    * PROBLEM DESCRIPTION: EntityManager.unwrap() with a           *
    *                      specific Connection implementation      *
    *                      class returns null.                     *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    OpenJPA's connection wrapper doesn't properly adhere to
    Connection.unwrap() contract.
    

Problem conclusion

  • OpenJPA's DelegatingConnection class has been updated to
    properly adhere to the Connection.unwrap() contract, and will
    forward unwrap() invocations to the wrappered Connection for
    Class types it does not recognize.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 8.5.5.9. 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

    PI46699

  • Reported component name

    LIBERTY PROFILE

  • Reported component ID

    5724J0814

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2015-08-11

  • Closed date

    2015-11-19

  • Last modified date

    2015-11-19

  • 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

    LIBERTY PROFILE

  • Fixed component ID

    5724J0814

Applicable component levels

  • R850 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
15 October 2021