Skip to content

Warnings when openeing a connection #382

@girglm

Description

@girglm

Hello,
In my C++ code i am trying to connect with an Oracle user where the password is in the grace period.
But i always get an exception and an invalid connection object.
I tried setting ocilib::Environment::EnableWarnings(false), but without success.
Looking at the code i could get it to run by changing

ocilib/include/ocilibcpp/detail/core/Utils.hpp

        template<class T>
        T Check(T result)
        {
            OCI_Error* err = OCI_GetLastError();

            if (err)
            {
                throw Exception(err);
            }

            return result;
        }

to

        template<class T>
        T Check(T result)
        {
            OCI_Error* err = OCI_GetLastError();

            if (err)
            {
                if (OCI_ErrorGetType(err) != OCI_ERR_WARNING)
                {
                    throw Exception(err);
                }
            }

            return result;
        }

Maybe i am missing something here, or is this a bug?

Best wishes
Georg

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions