Oracle Solution for Error ora-31227

Solution for Oracle Error ORA-31227

ORA-31227: DBMS_LDAP: invalid LDAP MESSAGE handle

What triggered the Error:

An attempt was made by a PL/SQL module to use an LDAP MESSAGE handle which is not valid and might have already been freed.

What should we do to fix it:

Check the LDAP MESSAGE handle in PL/SQL module involving DBMS_LDAP.