Hi Gary,
                Forgot to say that there are lots of white spaces especially in 
utils.cc, please remove all of them and check at other places also.

Thanks
-Nagu

> -----Original Message-----
> From: Nagendra Kumar
> Sent: 28 July 2016 16:42
> To: Gary Lee; [email protected]; Praveen Malviya;
> [email protected]; [email protected]
> Cc: [email protected]
> Subject: Re: [devel] [PATCH 1 of 1] amfnd: add preliminary support for BAD
> OM handles [#1833]
> 
> Hi Gary,
>       Ack with the following comment:
> 
> There is chance of getting Amfnd into loop, so please change :
> 
> 
>         // this loop construct is to handle BAD_HANDLE from
> immutil_saImmOmSearchNext_2()
>         for (;;) {
> 
> To
> As implemented in avd_imm_reinit_bg_thread in amfd-> imm.cc
>         while (++no_of_retries < MAX_NO_RETRIES) {
> 
> Thanks
> -Nagu
> 
> > -----Original Message-----
> > From: Gary Lee [mailto:[email protected]]
> > Sent: 12 July 2016 15:49
> > To: Nagendra Kumar; [email protected]; Praveen Malviya;
> > [email protected]; [email protected];
> > [email protected]
> > Cc: [email protected]
> > Subject: [PATCH 1 of 1] amfnd: add preliminary support for BAD OM
> > handles [#1833]
> >
> >  osaf/services/saf/amf/amfnd/clm.cc              |   4 +-
> >  osaf/services/saf/amf/amfnd/compdb.cc           |  95 ++++++++++++++-----
> ---
> > --
> >  osaf/services/saf/amf/amfnd/hcdb.cc             |   8 +-
> >  osaf/services/saf/amf/amfnd/include/avnd_util.h |  16 ++++
> >  osaf/services/saf/amf/amfnd/main.cc             |   6 +-
> >  osaf/services/saf/amf/amfnd/sidb.cc             |  10 +-
> >  osaf/services/saf/amf/amfnd/su.cc               |  12 +-
> >  osaf/services/saf/amf/amfnd/util.cc             |  85
> ++++++++++++++++++++++
> >  8 files changed, 175 insertions(+), 61 deletions(-)
> >
> >
> > Introduce wrapper functions for some immutil calls that are likely to
> > return BAD_HANDLE when there is MDS message loss detected. The
> wrapper
> > functions will reinitialize with IMM once, if IMMA returns BAD_HANDLE.
> >
> > This is a temporary solution only and should be re-worked when #1609
> > is completed.
> >
> > diff --git a/osaf/services/saf/amf/amfnd/clm.cc
> > b/osaf/services/saf/amf/amfnd/clm.cc
> > --- a/osaf/services/saf/amf/amfnd/clm.cc
> > +++ b/osaf/services/saf/amf/amfnd/clm.cc
> > @@ -128,9 +128,9 @@ static void clm_to_amf_node(void)
> >             goto done1;
> >     }
> >
> > -   error = immutil_saImmOmSearchInitialize_2(immOmHandle, nullptr,
> > SA_IMM_SUBTREE,
> > +   error = amf_saImmOmSearchInitialize_2(immOmHandle, nullptr,
> > SA_IMM_SUBTREE,
> >                                     SA_IMM_SEARCH_ONE_ATTR |
> > SA_IMM_SEARCH_GET_ALL_ATTR,
> > -                                   &searchParam,nullptr,
> > &searchHandle);
> > +                                   &searchParam, nullptr,
> > searchHandle);
> >
> >     if (SA_AIS_OK != error) {
> >             LOG_ER("No objects found");
> > diff --git a/osaf/services/saf/amf/amfnd/compdb.cc
> > b/osaf/services/saf/amf/amfnd/compdb.cc
> > --- a/osaf/services/saf/amf/amfnd/compdb.cc
> > +++ b/osaf/services/saf/amf/amfnd/compdb.cc
> > @@ -128,8 +128,8 @@ static SaAisErrorT avnd_compglobalattrs_
> >
> >     dn.length = strlen((char *)dn.value);
> >
> > -   immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > -   rc = immutil_saImmOmAccessorGet_2(accessorHandle, &dn, nullptr,
> > (SaImmAttrValuesT_2 ***)&attributes);
> > +   amf_saImmOmAccessorInitialize(immOmHandle, accessorHandle);
> > +   rc = amf_saImmOmAccessorGet_2(immOmHandle, accessorHandle,
> > &dn, nullptr, (SaImmAttrValuesT_2 ***)&attributes);
> >     if (rc != SA_AIS_OK) {
> >             LOG_ER("saImmOmAccessorGet_2 FAILED %u", rc);
> >             goto done;
> > @@ -1130,10 +1130,10 @@ static amf_comp_type_t *avnd_comptype_cr
> >
> >     compt = new amf_comp_type_t();
> >
> > -   (void)immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > +   (void)amf_saImmOmAccessorInitialize(immOmHandle,
> > accessorHandle);
> >
> > -   if (immutil_saImmOmAccessorGet_2(accessorHandle, dn, nullptr,
> > (SaImmAttrValuesT_2 ***)&attributes) != SA_AIS_OK) {
> > -           LOG_ER("saImmOmAccessorGet_2 FAILED for '%s'", dn-
> > >value);
> > +   if (amf_saImmOmAccessorGet_2(immOmHandle, accessorHandle,
> > dn, nullptr, (SaImmAttrValuesT_2 ***)&attributes) != SA_AIS_OK) {
> > +           LOG_ER("amf_saImmOmAccessorGet_2 FAILED for '%s'", dn-
> > >value);
> >             goto done;
> >     }
> >
> > @@ -1336,10 +1336,10 @@ static int get_string_attr_from_imm(SaIm
> >     SaAisErrorT error;
> >     TRACE_ENTER();
> >
> > -   immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > +   amf_saImmOmAccessorInitialize(immOmHandle, accessorHandle);
> >
> > -   if ((error = immutil_saImmOmAccessorGet_2(accessorHandle, dn,
> > attributeNames, (SaImmAttrValuesT_2 ***)&attributes)) != SA_AIS_OK) {
> > -           TRACE("saImmOmAccessorGet FAILED %u for %s", error, dn-
> > >value);
> > +   if ((error = amf_saImmOmAccessorGet_2(immOmHandle,
> > accessorHandle, dn, attributeNames, (SaImmAttrValuesT_2
> > ***)&attributes)) != SA_AIS_OK) {
> > +           TRACE("amf_saImmOmAccessorGet FAILED %u for %s",
> > error, dn->value);
> >             goto done;
> >     }
> >
> > @@ -1836,36 +1836,49 @@ unsigned int avnd_comp_config_get_su(AVN
> >
> >     TRACE_ENTER2("SU'%s'", su->name.value);
> >
> > -   error = saImmOmInitialize_cond(&immOmHandle, nullptr,
> > &immVersion);
> > -   if (error != SA_AIS_OK) {
> > -           LOG_CR("saImmOmInitialize failed: %u", error);
> > -           goto done;
> > +   // this loop construct is to handle BAD_HANDLE from
> > immutil_saImmOmSearchNext_2()
> > +   for (;;) {
> > +           error = saImmOmInitialize_cond(&immOmHandle, nullptr,
> > &immVersion);
> > +           if (error != SA_AIS_OK) {
> > +                   LOG_CR("saImmOmInitialize failed: %u", error);
> > +                   goto done;
> > +           }
> > +           searchParam.searchOneAttr.attrName =
> > const_cast<SaImmAttrNameT>("SaImmAttrClassName");
> > +           searchParam.searchOneAttr.attrValueType =
> > SA_IMM_ATTR_SASTRINGT;
> > +           searchParam.searchOneAttr.attrValue = &className;
> > +
> > +           if ((error = amf_saImmOmSearchInitialize_2(immOmHandle,
> > &su->name,
> > +                   SA_IMM_SUBTREE, SA_IMM_SEARCH_ONE_ATTR |
> > SA_IMM_SEARCH_GET_CONFIG_ATTR,
> > +                   &searchParam, nullptr, searchHandle)) != SA_AIS_OK)
> > {
> > +
> > +                   LOG_ER("amf_saImmOmSearchInitialize_2 failed:
> > %u", error);
> > +                   goto done1;
> > +           }
> > +
> > +           while (error == SA_AIS_OK) {
> > +                   error =
> > immutil_saImmOmSearchNext_2(searchHandle, &comp_name,
> > +                           (SaImmAttrValuesT_2 ***)&attributes);
> > +
> > +                   if (error != SA_AIS_OK) {
> > +                           break;
> > +                   }
> > +
> > +                   TRACE_1("'%s'", comp_name.value);
> > +                   if(0 == m_AVND_COMPDB_REC_GET(avnd_cb-
> > >compdb, comp_name)) {
> > +                           if ((comp =
> > avnd_comp_create(&comp_name, attributes, su)) == nullptr)
> > +                                   goto done2;
> > +
> > +                           avnd_hc_config_get(comp);
> > +                   }
> > +           }
> > +
> > +           if (error == SA_AIS_ERR_BAD_HANDLE) {
> > +                   continue;
> > +           }
> > +
> > +           rc = NCSCC_RC_SUCCESS;
> > +           break;
> >     }
> > -   searchParam.searchOneAttr.attrName =
> > const_cast<SaImmAttrNameT>("SaImmAttrClassName");
> > -   searchParam.searchOneAttr.attrValueType =
> > SA_IMM_ATTR_SASTRINGT;
> > -   searchParam.searchOneAttr.attrValue = &className;
> > -
> > -   if ((error = immutil_saImmOmSearchInitialize_2(immOmHandle, &su-
> > >name,
> > -           SA_IMM_SUBTREE, SA_IMM_SEARCH_ONE_ATTR |
> > SA_IMM_SEARCH_GET_CONFIG_ATTR,
> > -           &searchParam, nullptr, &searchHandle)) != SA_AIS_OK) {
> > -
> > -           LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
> > -           goto done1;
> > -   }
> > -
> > -   while (immutil_saImmOmSearchNext_2(searchHandle,
> > &comp_name,
> > -           (SaImmAttrValuesT_2 ***)&attributes) == SA_AIS_OK) {
> > -
> > -           TRACE_1("'%s'", comp_name.value);
> > -           if(0 == m_AVND_COMPDB_REC_GET(avnd_cb->compdb,
> > comp_name)) {
> > -                   if ((comp = avnd_comp_create(&comp_name,
> > attributes, su)) == nullptr)
> > -                           goto done2;
> > -
> > -                   avnd_hc_config_get(comp);
> > -           }
> > -   }
> > -
> > -   rc = NCSCC_RC_SUCCESS;
> >
> >   done2:
> >     (void)immutil_saImmOmSearchFinalize(searchHandle);
> > @@ -1912,15 +1925,15 @@ int avnd_comp_config_reinit(AVND_COMP *c
> >             LOG_CR("saImmOmInitialize FAILED for '%s'", comp-
> > >name.value);
> >             goto done1;
> >     }
> > -   error = immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > +   error = amf_saImmOmAccessorInitialize(immOmHandle,
> > accessorHandle);
> >     if (error != SA_AIS_OK) {
> > -           LOG_CR("immutil_saImmOmAccessorInitialize FAILED for
> > '%s'", comp->name.value);
> > +           LOG_CR("amf_saImmOmAccessorInitialize FAILED for '%s'",
> > comp->name.value);
> >             goto done2;
> >     }
> > -   if (immutil_saImmOmAccessorGet_2(accessorHandle, &comp-
> > >name, nullptr,
> > +   if (amf_saImmOmAccessorGet_2(immOmHandle, accessorHandle,
> > &comp->name, nullptr,
> >             (SaImmAttrValuesT_2 ***)&attributes) != SA_AIS_OK) {
> >
> > -           LOG_ER("saImmOmAccessorGet_2 FAILED for '%s'", comp-
> > >name.value);
> > +           LOG_ER("amf_saImmOmAccessorGet_2 FAILED for '%s'",
> > comp->name.value);
> >             goto done3;
> >     }
> >
> > diff --git a/osaf/services/saf/amf/amfnd/hcdb.cc
> > b/osaf/services/saf/amf/amfnd/hcdb.cc
> > --- a/osaf/services/saf/amf/amfnd/hcdb.cc
> > +++ b/osaf/services/saf/amf/amfnd/hcdb.cc
> > @@ -259,9 +259,9 @@ SaAisErrorT avnd_hc_config_get(AVND_COMP
> >     searchParam.searchOneAttr.attrValueType =
> SA_IMM_ATTR_SASTRINGT;
> >     searchParam.searchOneAttr.attrValue = &className;
> >
> > -   error = immutil_saImmOmSearchInitialize_2(immOmHandle,
> > &comp_dn,
> > +   error = amf_saImmOmSearchInitialize_2(immOmHandle, &comp_dn,
> >             SA_IMM_SUBTREE, SA_IMM_SEARCH_ONE_ATTR |
> > SA_IMM_SEARCH_GET_ALL_ATTR,
> > -           &searchParam, nullptr, &searchHandle);
> > +           &searchParam, nullptr, searchHandle);
> >
> >     if (SA_AIS_OK != error) {
> >             LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
> @@ -334,9
> > +334,9 @@ SaAisErrorT avnd_hctype_config_get(SaImm
> >     searchParam.searchOneAttr.attrValueType =
> SA_IMM_ATTR_SASTRINGT;
> >     searchParam.searchOneAttr.attrValue = &className;
> >
> > -   error = immutil_saImmOmSearchInitialize_2(immOmHandle,
> > comptype_dn,
> > +   error = amf_saImmOmSearchInitialize_2(immOmHandle,
> > comptype_dn,
> >             SA_IMM_SUBTREE, SA_IMM_SEARCH_ONE_ATTR |
> > SA_IMM_SEARCH_GET_ALL_ATTR,
> > -           &searchParam, nullptr, &searchHandle);
> > +           &searchParam, nullptr, searchHandle);
> >
> >     if (SA_AIS_OK != error) {
> >             LOG_ER("saImmOmSearchInitialize_2 failed: %u", error); diff
> --git
> > a/osaf/services/saf/amf/amfnd/include/avnd_util.h
> > b/osaf/services/saf/amf/amfnd/include/avnd_util.h
> > --- a/osaf/services/saf/amf/amfnd/include/avnd_util.h
> > +++ b/osaf/services/saf/amf/amfnd/include/avnd_util.h
> > @@ -61,4 +61,20 @@ void free_n2d_nd_csicomp_state_info(AVSV
> >  void free_n2d_nd_sisu_state_info(AVSV_DND_MSG *msg);  SaAisErrorT
> > saImmOmInitialize_cond(SaImmHandleT *immHandle,
> >     const SaImmCallbacksT *immCallbacks, SaVersionT *version);
> > +SaAisErrorT amf_saImmOmAccessorInitialize(SaImmHandleT&
> immHandle,
> > +      SaImmAccessorHandleT& accessorHandle); SaAisErrorT
> > +amf_saImmOmSearchInitialize_2(SaImmHandleT& immHandle,
> > +      const SaNameT * rootName,
> > +      SaImmScopeT scope,
> > +      SaImmSearchOptionsT searchOptions,
> > +      const SaImmSearchParametersT_2 *
> > +      searchParam,
> > +      const SaImmAttrNameT *
> > +      attributeNames,
> > +      SaImmSearchHandleT& searchHandle); SaAisErrorT
> > +amf_saImmOmAccessorGet_2(SaImmHandleT& immHandle,
> > +   SaImmAccessorHandleT& accessorHandle,
> > +   const SaNameT * objectName,
> > +   const SaImmAttrNameT * attributeNames,
> > +   SaImmAttrValuesT_2 *** attributes);
> >  #endif   /* !AVND_UTIL_H */
> > diff --git a/osaf/services/saf/amf/amfnd/main.cc
> > b/osaf/services/saf/amf/amfnd/main.cc
> > --- a/osaf/services/saf/amf/amfnd/main.cc
> > +++ b/osaf/services/saf/amf/amfnd/main.cc
> > @@ -695,12 +695,12 @@ static void hydra_config_get(AVND_CB *cb
> >     dn.length = strlen((char *)dn.value);
> >
> >     immutil_saImmOmInitialize(&immOmHandle, nullptr, &immVersion);
> > -   immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > -   rc = immutil_saImmOmAccessorGet_2(accessorHandle, &dn,
> > attributeNames,
> > +   amf_saImmOmAccessorInitialize(immOmHandle, accessorHandle);
> > +   rc = amf_saImmOmAccessorGet_2(immOmHandle, accessorHandle,
> > &dn, attributeNames,
> >             (SaImmAttrValuesT_2 ***)&attributes);
> >
> >     if (rc != SA_AIS_OK) {
> > -           LOG_WA("saImmOmAccessorGet_2 FAILED %u for %s", rc,
> > dn.value);
> > +           LOG_WA("amf_saImmOmAccessorGet_2 FAILED %u for %s",
> > rc, dn.value);
> >             goto done;
> >     }
> >
> > diff --git a/osaf/services/saf/amf/amfnd/sidb.cc
> > b/osaf/services/saf/amf/amfnd/sidb.cc
> > --- a/osaf/services/saf/amf/amfnd/sidb.cc
> > +++ b/osaf/services/saf/amf/amfnd/sidb.cc
> > @@ -251,9 +251,9 @@ static void get_cstype(SaImmHandleT immO
> >     // TODO remove, just for test
> >     LOG_NO("get_cstype: csi = '%s'", csi_name->value);
> >
> > -   if ((error = immutil_saImmOmAccessorGet_2(accessorHandle,
> > csi_name,
> > +   if ((error = amf_saImmOmAccessorGet_2(immOmHandle,
> > accessorHandle, csi_name,
> >                     attributeNames, (SaImmAttrValuesT_2
> > ***)&attributes)) != SA_AIS_OK) {
> > -           LOG_ER("saImmOmAccessorGet FAILED %u for %s", error,
> > csi_name->value);
> > +           LOG_ER("amf_saImmOmAccessorGet FAILED %u for %s",
> > error, csi_name->value);
> >             osafassert(0);
> >     }
> >
> > @@ -287,14 +287,14 @@ static SaAmfCompCapabilityModelT get_com
> >             LOG_CR("saImmOmInitialize failed: %u", error);
> >             goto done1;
> >     }
> > -   immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > +   amf_saImmOmAccessorInitialize(immOmHandle, accessorHandle);
> >
> >     get_cstype(immOmHandle, accessorHandle, csi_name, &cs_type);
> >     avsv_create_association_class_dn(&cs_type, comp_type,
> > "safSupportedCsType", &dn);
> >
> > -   if ((error = immutil_saImmOmAccessorGet_2(accessorHandle, &dn,
> > attributeNames,
> > +   if ((error = amf_saImmOmAccessorGet_2(immOmHandle,
> > accessorHandle, &dn, attributeNames,
> >                     (SaImmAttrValuesT_2 ***)&attributes)) !=
> > SA_AIS_OK) {
> > -           LOG_ER("saImmOmAccessorGet FAILED %u for'%s'", error,
> > dn.value);
> > +           LOG_ER("amf_saImmOmAccessorGet FAILED %u for'%s'",
> > error, dn.value);
> >             goto done;
> >     }
> >
> > diff --git a/osaf/services/saf/amf/amfnd/su.cc
> > b/osaf/services/saf/amf/amfnd/su.cc
> > --- a/osaf/services/saf/amf/amfnd/su.cc
> > +++ b/osaf/services/saf/amf/amfnd/su.cc
> > @@ -68,13 +68,13 @@ static bool get_su_failover(const SaName
> >             LOG_CR("saImmOmInitialize failed: %u", error);
> >             goto done1;
> >     }
> > -   immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > +   amf_saImmOmAccessorInitialize(immOmHandle, accessorHandle);
> >
> >     /* Use an attribute name list to avoid reading runtime attributes
> > which
> >      * causes callbacks executed in AMF director. */
> > -   if (immutil_saImmOmAccessorGet_2(accessorHandle, name,
> > attributeNames,
> > +   if (amf_saImmOmAccessorGet_2(immOmHandle, accessorHandle,
> > name, attributeNames,
> >             (SaImmAttrValuesT_2 ***)&attributes) != SA_AIS_OK) {
> > -           LOG_ER("saImmOmAccessorGet_2 FAILED for '%s'", name-
> > >value);
> > +           LOG_ER("amf_saImmOmAccessorGet_2 FAILED for '%s'",
> > name->value);
> >             goto done;
> >     }
> >
> > @@ -86,7 +86,7 @@ static bool get_su_failover(const SaName
> >
> >                     attributeNames[0] =
> > const_cast<SaImmAttrNameT>("saAmfSutDefSUFailover");
> >                     attributeNames[1] = nullptr;
> > -                   if
> > (immutil_saImmOmAccessorGet_2(accessorHandle, &sutype, nullptr,
> > +                   if (amf_saImmOmAccessorGet_2(immOmHandle,
> > accessorHandle, &sutype, nullptr,
> >                                     (SaImmAttrValuesT_2
> > ***)&attributes) == SA_AIS_OK) {
> >
> >     immutil_getAttr(const_cast<SaImmAttrNameT>("saAmfSutDefSUFail
> > over"),
> >                                     attributes, 0, &sufailover);
> > @@ -332,9 +332,9 @@ static uint32_t get_sirank(const SaNameT
> >             LOG_CR("saImmOmInitialize failed: %u", error);
> >             goto done;
> >     }
> > -   immutil_saImmOmAccessorInitialize(immOmHandle,
> > &accessorHandle);
> > +   amf_saImmOmAccessorInitialize(immOmHandle, accessorHandle);
> >
> > -   osafassert((error =
> > immutil_saImmOmAccessorGet_2(accessorHandle, dn,
> > +   osafassert((error = amf_saImmOmAccessorGet_2(immOmHandle,
> > accessorHandle, dn,
> >             attributeNames, (SaImmAttrValuesT_2 ***)&attributes)) ==
> > SA_AIS_OK);
> >
> >     osafassert((error = immutil_getAttr(attributeNames[0], attributes,
> > 0,
> > &rank)) == SA_AIS_OK);
> > diff --git a/osaf/services/saf/amf/amfnd/util.cc
> > b/osaf/services/saf/amf/amfnd/util.cc
> > --- a/osaf/services/saf/amf/amfnd/util.cc
> > +++ b/osaf/services/saf/amf/amfnd/util.cc
> > @@ -818,3 +818,88 @@ SaAisErrorT saImmOmInitialize_cond(SaImm
> >     // cause the watchdog to kill AMFND.
> >     return saImmOmInitialize(immHandle, immCallbacks, version);  }
> > +
> > +SaAisErrorT amf_saImmOmInitialize(SaImmHandleT& immHandle) {
> > +   SaVersionT immVersion = { 'A', 2, 11 };
> > +   return saImmOmInitialize_cond(&immHandle, nullptr, &immVersion);
> }
> > +
> > +SaAisErrorT amf_saImmOmAccessorInitialize(SaImmHandleT&
> immHandle,
> > +      SaImmAccessorHandleT& accessorHandle) {
> > +   // note: this will handle SA_AIS_ERR_BAD_HANDLE just once
> > +   SaAisErrorT rc = immutil_saImmOmAccessorInitialize(immHandle,
> > &accessorHandle);
> > +   if (rc == SA_AIS_ERR_BAD_HANDLE) {
> > +           rc = amf_saImmOmInitialize(immHandle);
> > +
> > +           // re-attempt immutil_saImmOmAccessorInitialize once
> > more
> > +           if (rc == SA_AIS_OK) {
> > +                   rc = immutil_saImmOmAccessorInitialize(immHandle,
> > &accessorHandle);
> > +           }
> > +   }
> > +
> > +   return rc;
> > +}
> > +
> > +SaAisErrorT amf_saImmOmSearchInitialize_2(SaImmHandleT&
> immHandle,
> > +      const SaNameT * rootName,
> > +      SaImmScopeT scope,
> > +      SaImmSearchOptionsT searchOptions,
> > +      const SaImmSearchParametersT_2 *
> > +      searchParam,
> > +      const SaImmAttrNameT *
> > +      attributeNames,
> > +      SaImmSearchHandleT& searchHandle) {
> > +   // note: this will handle SA_AIS_ERR_BAD_HANDLE just once
> > +   SaAisErrorT rc = immutil_saImmOmSearchInitialize_2(immHandle,
> > +           rootName,
> > +           scope,
> > +           searchOptions,
> > +           searchParam,
> > +           attributeNames,
> > +           &searchHandle);
> > +
> > +   if (rc == SA_AIS_ERR_BAD_HANDLE) {
> > +           rc = amf_saImmOmInitialize(immHandle);
> > +
> > +           // re-attempt immutil_saImmOmSearchInitialize_2 once
> > more
> > +           if (rc == SA_AIS_OK) {
> > +                   rc =
> > immutil_saImmOmSearchInitialize_2(immHandle,
> > +                           rootName,
> > +                           scope,
> > +                           searchOptions,
> > +                           searchParam,
> > +                           attributeNames,
> > +                           &searchHandle);
> > +           }
> > +   }
> > +   return rc;
> > +}
> > +
> > +SaAisErrorT amf_saImmOmAccessorGet_2(SaImmHandleT& immHandle,
> > +   SaImmAccessorHandleT& accessorHandle,
> > +   const SaNameT * objectName,
> > +   const SaImmAttrNameT * attributeNames,
> > +   SaImmAttrValuesT_2 *** attributes)
> > +{
> > +   // note: this will handle SA_AIS_ERR_BAD_HANDLE just once
> > +   SaAisErrorT rc = immutil_saImmOmAccessorGet_2(accessorHandle,
> > +           objectName, attributeNames, attributes);
> > +
> > +   if (rc == SA_AIS_ERR_BAD_HANDLE) {
> > +           rc = amf_saImmOmInitialize(immHandle);
> > +
> > +           if (rc == SA_AIS_OK) {
> > +                   rc = amf_saImmOmAccessorInitialize(immHandle,
> > accessorHandle);
> > +           }
> > +
> > +           if (rc == SA_AIS_OK) {
> > +                   rc =
> > immutil_saImmOmAccessorGet_2(accessorHandle,
> > +                           objectName, attributeNames, attributes);
> > +           }
> > +   }
> > +
> > +   return rc;
> > +}
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Opensaf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to