IBM Support

JR59996: BatchOrderRequest fails to create order because it fails to create shipping address

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • It appears that there is a JPA handling issue, in that the
    BatchOrderRequest fails to create an order because it fails to
    create a shipping address.
    
    Based on AddressBookAccessBean.checkAddressBook(), it appears
    that it only catches a NoResultException, not also a
    NonUniqueResultException:
    
    private AddressBookAccessBean checkAddressBook(Long aMemberId) {
    AddressBookAccessBean abAddressBook = null;
    try {
    AddressBookAccessBean abAB = new AddressBookAccessBean();
    abAddressBook = abAB.findByMemberId(aMemberId);
    }
    catch (NoResultException e) {
    abAddressBook = new AddressBookAccessBean(aMemberId);
    }
    return abAddressBook;
    }
    
    That being said, this code segment might throw two types of
    exceptions:
    
    public AddressBookAccessBean findByMemberId(Long aMemberId) {
    if (aMemberId == null) {
    throw new NoResultException();
    }
    else {
    String queryName = ?AddressBook_findByMemberId?;
    Query query = getEntityManager().createNamedQuery(queryName);
    query.setParameter(1, aMemberId);
    return (AddressBookAccessBean)
    createAccessBean(query.getSingleResult());
    }
    }
    
    Based on the customer case, the process is summarized as
    follows:
    
    1. BatchOrderRequestCmdImpl.doProcess()
    2. calls CreateShippingBillingAddressCmd to create billing
    address
    3. calls CreateShippingBillingAddressCmd to create shipping
    address
    4. CreateShippingBillingAddressCmdImpl.performExecute()
    5. calls AddressAccessBean.findByNickname
    6. if not found
    7. new AddressBookAccessBean(memberId)
    8. new AddressAccessBean(memberId, nickname)
    9. AddressAccessBean(Long memberId, String nickName)
    10. calls AddressBookAccessBean.findByMemberId(aMemberId)
    11. if not found
    12. new AddressBookAccessBean(memberId)
    In v9, shipping address creation fails, because line 10 throws
    NonUniqueResultException but line 11 catch only
    NoResultException
    
    This class also needs to catch NonUniqueResultException and
    treat it like the EJB FinderException equivalent.
    

Local fix

Problem summary

  • USERS AFFECTED:
    V9
    
    PROBLEM ABSTRACT:
    BatchOrderRequest fails to create order because it fails to
    create shipping address
    
    BUSINESS IMPACT:
    Cannot create shipping address.
    
    RECOMMENDATION:
    

Problem conclusion

  • Catch the exception of NonUniqueResultException in
    AddressAccessBean.
    

Temporary fix

Comments

APAR Information

  • APAR number

    JR59996

  • Reported component name

    WC BUS EDITION

  • Reported component ID

    5724I3800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-09-07

  • Closed date

    2018-09-28

  • Last modified date

    2018-09-28

  • 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

    WC BUS EDITION

  • Fixed component ID

    5724I3800

Applicable component levels

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYSYL","label":"WebSphere Commerce Enterprise"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
28 September 2018