Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unexpected exception when reconnecting to database after init without connection to DB

User_WT0NDOct 15 2021

Our application runs in .NET 5
We use Entity Framework Core version 5.0.10
We also use the Oracle driver for EFCore for .NET, version 5.21.3
For connecting to the database we use Easy Connect.
This is what our connection string looks like:
"Data Source=server.industry.net/database;User Id=dataUser;Password=dataPassword"
The core of the issue is the following
We start the API without a connection to the database and we make an API-call (which requires a connection with the database)
Then this exception is thrown.
"ORA-12154: TNS:could not resolve the connect identifier specified"
(We do not use any TNS names.)
We then make the connection to the database available and retry the same API call that requires a connection with the database, the same ORA-12154 exception keeps being thrown.
In another scenario when we initialize the API with the connection to the DB active, then disconnect from the database, and then reconnect again, there is no exception after reconnecting and the connection is re-established successfully.
It seems like the Oracle provider is not able to ever connect with the database, if the API is started without a connection to the database. Even if the database connection is available afterwards
How can this problem be solved?

Comments
Post Details
Added on Oct 15 2021
1 comment
437 views