I have a simple application using oci.dll (Oracle.DataAccess and Oracle Instant Client) with the following code:
Console.WriteLine($"Connection create...");
using (var connection = new OracleConnection())
{
var osb = new OracleConnectionStringBuilder()
{
UserID = "user",
Password = "<password>",
DataSource = "database",
Pooling = false,
};
connection.ConnectionString = osb.ConnectionString;
Console.WriteLine($"Connection open...");
connection.Open();
try
{
Console.WriteLine($"Command create...");
using (var cmd = connection.CreateCommand())
{
cmd.CommandText = "select 1 from dual";
Console.WriteLine($"Command open...");
using (var reader = cmd.ExecuteReader())
{
Console.WriteLine($"Reader open...");
reader.Read();
var count = reader.GetDecimal(0);
Console.WriteLine($"DUAL: {count}");
}
}
}
finally
{
Console.WriteLine($"Connection close...");
connection.Close();
}
}
Console.WriteLine($"Done...");
After the application completes (when "Done..." is printed), additional calls to the server occur during the shutdown of the application. Tracing using Oracle trace files reveals the following functions are being executed:
- OpsDecFreeValCtx()
- OpsConFreeValCtx()
- OpsConOpen()
- And further communication via OCIServerAttach() and OCISessionBegin().
This behavior does not occur with oci18, but it happens consistently with oci21.
Question: How can I prevent these additional calls during application shutdown? Are there specific configurations or workarounds for oci21 that would stop this behavior?
Any insights or suggestions are greatly appreciated. Thanks in advance!