IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

ISAM - Updating Attributes Of Ldap From InfoMap

  • 1.  ISAM - Updating Attributes Of Ldap From InfoMap

    Posted Mon April 05, 2021 03:05 AM
    Edited by Mukesh Bhati Mon April 05, 2021 03:06 AM
    Hello Team,

    I'm using User class(com.ibm.security.access.user.User) in infoMap to modify the user attributes stored in LDAP.

    In one of the operation, I need to modified 2-3 attributes but I want Atomicity in the transaction i.e, all attributes should be update or non of the attribute should be updated.

    Current flow:

    user.replaceAttribute("attr1","value1");
    user.replaceAttribute("attr2","value2");
    user.replaceAttribute("attr3","value3");

    What we want, supposed if 1st and 2nd attribute updated successfully but while updating 3rd attribute if got some error then above attributes should be rollback

    How can we achieve this?

    Any pointer could be helpful.

    ------------------------------
    Mukesh
    ------------------------------


  • 2.  RE: ISAM - Updating Attributes Of Ldap From InfoMap

    Posted Fri April 09, 2021 07:44 AM
    Edited by Joao Goncalves Fri April 09, 2021 07:47 AM
    This is an interesting question. What you need is the capability of using transactions. Apparently, when you issue a "replaceAttribute" it will be automatically be committed.

    First you would need to check if your LDAP supports transactions! Then you have to check if there is a way in ISVA to make all those calls in one single transaction.
    like:
    being_transaction ();
    user.replaceAttribute("attr1","value1");
    user.replaceAttribute("attr2","value2");
    user.replaceAttribute("attr3","value3");
    commit (); // or rollback();

    An alternative to this would be to implement this with "compensation", You can implement like this:
    attr1_oldvalue = ...;
    attr2_oldvalue=...;
    user.replaceAttribute("attr2", " newvalue2");
    if (not successfull) {
         // compensate attr1, since attr2 failed to update
        user.replaceAttribute("attr1", "attr1_oldvalue");
    }

    ------------------------------
    Joao Goncalves
    Pyxis, Lda.
    Sintra
    +351 91 721 4994
    ------------------------------