Oracle Solution for Error ora-32165

Solution for Oracle Error ORA-32165

ORA-32165: Cannot get XA environment

What triggered the Error:

Incorrect dbname string was passed or the XA connection has not been opened

What should we do to fix it:

Pass the correct dbname string or check if the XA connection is open