Monitoring Connection Pool with DBMonitor
Posted: Wed 25 Apr 2012 15:57
Hello,
I would like to monitor the pooling features of Devart. I know that it is possible with the DBMonitor application, but I would like to do that in code (with OracleMonitor class) and I don't want to parse some text to know what the pool is doing and what is the current pooling status.
Here is what I need to know :
- The pool open a connection (Connect Event from DbConnectionPool)
- The pool activate a connection (ActivateInPool Event)
- The pool get back a connection (ReturnToPool Event)
- The pool close a connection (Disconnect Event from DbConnectionPool)
Everything is right when ActivateInPool is triggered because it is triggered twice. Firstly with an OracleConnection sender and secondly with a DbConnectionPool(which seems to be a devart internal class). Here I can use ActivateInPool + sender is OracleConnection to get all the needed information.
However, ReturnToPool Event does not trigger with an OracleConnection sender. It is triggered only once with a DbConnectionPool sender and ExtraInfo property is empty. Here there is no way to know which connection pool is concerned.
To filter the Open connection in pool events (which has also a DbConnectionPool sender) I can test sender.GetType().FullName == "Devart.Common.DbConnectionPool" but this seems a bit dirty ... This is the same when I filter the Disconnect connection in pool event.
Can you explain me how can I monitor the pool via the OracleMonitor ? It should be possible for me to monitor the pool if the connection string is always provided in the ExtraInfo.
If the OracleMonitor is not intended to get information about pooling can you tell me how do I get the pool status of a connection at any time ? Also, is it possible to know the pooling status through performance counter ?
Thanks in advance,
I would like to monitor the pooling features of Devart. I know that it is possible with the DBMonitor application, but I would like to do that in code (with OracleMonitor class) and I don't want to parse some text to know what the pool is doing and what is the current pooling status.
Here is what I need to know :
- The pool open a connection (Connect Event from DbConnectionPool)
- The pool activate a connection (ActivateInPool Event)
- The pool get back a connection (ReturnToPool Event)
- The pool close a connection (Disconnect Event from DbConnectionPool)
Everything is right when ActivateInPool is triggered because it is triggered twice. Firstly with an OracleConnection sender and secondly with a DbConnectionPool(which seems to be a devart internal class). Here I can use ActivateInPool + sender is OracleConnection to get all the needed information.
However, ReturnToPool Event does not trigger with an OracleConnection sender. It is triggered only once with a DbConnectionPool sender and ExtraInfo property is empty. Here there is no way to know which connection pool is concerned.
To filter the Open connection in pool events (which has also a DbConnectionPool sender) I can test sender.GetType().FullName == "Devart.Common.DbConnectionPool" but this seems a bit dirty ... This is the same when I filter the Disconnect connection in pool event.
Can you explain me how can I monitor the pool via the OracleMonitor ? It should be possible for me to monitor the pool if the connection string is always provided in the ExtraInfo.
If the OracleMonitor is not intended to get information about pooling can you tell me how do I get the pool status of a connection at any time ? Also, is it possible to know the pooling status through performance counter ?
Thanks in advance,