Oracle connection pool issue in Devart

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Raghupathi
Posts: 1
Joined: Wed 12 Apr 2017 13:10

Oracle connection pool issue in Devart

Post by Raghupathi » Wed 12 Apr 2017 13:18

Hi

I'm facing the below issue by using this Devart.Data.Oracle 7.1.40.0.
Could you please look into the below issue and suggest the solutions


Call Stack


ntdll!ZwWaitForSingleObject+a
ntdll!RtlpWaitOnCriticalSection+e8
ntdll!RtlEnterCriticalSection+d1
oracore11!sltsmna+1c
OraClient11!kpuhhfrh+5cb
OraClient11!kpufhndl0+17c5
OraClient11!kpufhndl+e
OraClient11!OCIHandleFree+15
oci!OCIHandleFree+71
DomainBoundILStubClass.IL_STUB_PInvoke(System.Runtime.InteropServices.HandleRef, Int32)+67
OciDynamicType.OCIHandleFree(System.Runtime.InteropServices.HandleRef, Int32)+29
Devart.Data.Oracle.a7.c()
Devart.Data.Oracle.bg.j()
Devart.Data.Oracle.OracleInternalConnection..ctor(Devart.Data.Oracle.ah, Devart.Data.Oracle.OracleInternalConnection)
clr!ExceptionTracker::CallHandler+c5
clr!ExceptionTracker::CallCatchHandler+78
clr!ProcessCLRException+2e2
ntdll!RtlpExecuteHandlerForUnwind+d
ntdll!RtlUnwindEx+539
clr!ClrUnwindEx+40
clr!ProcessCLRException+2b2
ntdll!RtlpExecuteHandlerForException+d
ntdll!RtlDispatchException+45a
ntdll!RtlRaiseException+22f
KERNELBASE!RaiseException+39
clr!RaiseTheExceptionInternalOnly+28b
clr!IL_Throw+e3
Devart.Data.Oracle.bg.a(Devart.Data.Oracle.ah, Devart.Data.Oracle.ao)
Devart.Data.Oracle.OracleInternalConnection..ctor(Devart.Data.Oracle.ah, Devart.Data.Oracle.OracleInternalConnection)
Devart.Data.Oracle.df.a(Devart.Common.i, System.Object, Devart.Common.DbConnectionBase)
Devart.Common.DbConnectionFactory.a(Devart.Common.DbConnectionPool, Devart.Common.i, Devart.Common.DbConnectionBase)
Devart.Common.DbConnectionPool.a(Devart.Common.DbConnectionBase)
Devart.Common.DbConnectionPool.GetObject(Devart.Common.DbConnectionBase)
Devart.Common.DbConnectionFactory.b(Devart.Common.DbConnectionBase)
Devart.Common.DbConnectionClosed.Open(Devart.Common.DbConnectionBase)
Devart.Common.DbConnectionBase.Open()
Devart.Data.Oracle.OracleConnection.Open()
DataConnectors.Oracle.OracleDataConnector.GetCommand(System.String)
DataConnectors.Oracle.OracleDataConnector.GetAllSynonymObjects()
DataConnectors.Oracle.OracleDataConnector.BuildSqlRetrieveTablesInDatabase()
.DataConnectors.Oracle.OracleDataConnector.Relations(Execution.IExecutionContext,.LogEntry)
clr!CallDescrWorkerInternal+83
clr!CallDescrWorkerWithHandler+4a
clr!CallDescrWorkerReflectionWrapper+1a
clr!RuntimeMethodHandle::InvokeMethod+40f
mscorlib_ni+54d28c
mscorlib_ni+54e2b1
mscorlib_ni+53491e

Code: Select all

private OracleConnection GetConnection()
{
var connection = new OracleConnection(ConnectionString);

return connection;
}

protected override DbCommand GetCommand(string value)
{
var connection = GetConnection();

connection.Open();

var command = new OracleCommand(value, connection) {CommandType = CommandType.Text};

return command;
}

private IEnumerable<OracleDataObject> GetAllSynonymObjects()
{
var dataObjects = new List<OracleDataObject>();
var connectionUserId = SqlHelper.GetConnectionStringItem(ConnectionString, USER_ID_REG_EX_PATTERN);
var command = GetCommand(string.Format(ALL_SYNONYMS_SQL, connectionUserId));

using (IDataReader dataReader = command.ExecuteReader(CommandBehavior.CloseConnection))
{
while (dataReader.Read())
{
var dataObject = new OracleDataObject
{
Name = SqlHelper.ConvertToString(dataReader["SYNONYM_NAME"]),
DbLink = SqlHelper.ConvertToString(dataReader["DB_LINK"]),
OriginalName = SqlHelper.ConvertToString(dataReader["TABLE_NAME"]),
Owner = SqlHelper.ConvertToString(dataReader["OWNER"]),
TableOwner = SqlHelper.ConvertToString(dataReader["TABLE_OWNER"])
};

dataObject.Description = SqlHelper.ConvertToString(dataReader["TABLE_OWNER"]) + "." +
dataObject.Name + " => " +
SqlHelper.ConvertToString(dataReader["TABLE_NAME"]);

dataObjects.Add(dataObject);
}
}

return dataObjects;
}


Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Oracle connection pool issue in Devart

Post by Pinturiccio » Thu 13 Apr 2017 14:41

Please provide the following information:
1. Do you get an exception or your application hangs?
2. If you got an exception, please send us the exception message, and if there are inner exceptions, send us their exception messages too.

It’s also possible that you have reached the connection pool limit. You open a connection in the GetCommand method. The GetAllSynonymObjects method closes the connection after clising dataReader. However, if GetCommand was called for an object, and GetAllSynonymObjects wasn’t, the connection stays open.

You may have reached the maximal number of connections in the connection pool. This value is set in the 'Max Pool Size' connection string parameter and is equal to 100 by default. For more information, please refer to https://www.devart.com/dotconnect/oracl ... lSize.html

If a MaxPoolSize number of connections with the same connection string is open simultaneously, opening a new connection with the same connection string will produce an error.

Post Reply