Environment: Visual Studio C++ 2022, Windows Server 2019 Datacenter, Oracle Database, Oracle Data Access Components (ODAC)
Hi,
I have developed C++ server application which works by 24x7. My application uses Oracle OleDB to connect Oracle database. After connecting to Oracle database, connection object is being cached. Sometime this connection object become invalid and it report error 'Not connected to Oracle'. At that time my program retry to connect Oracle database but it fails.
When I restart application, program connect to Oracle database successfully.
Oracle OleDB function which are being used
CDataSource::OpenFromInitializationString is being used to connect oracle database.
CDataSource::Close() is being to close connection.
CSession::Open() is being used to open session.
CSession::Close() is being used to close session.
My requirement is that to restore Oracle connection without restarting program.
Any idea how this issue can be resolved?
Thanks in advance. Regards, Vijay Kumar Singh
Nowadays these problems are better addressed by JDBC drivers than OCI ones. But still you can search for:
(ENABLE=BROKEN)in Oracle's connection string