| Devart.Data.Oracle Namespace : OracleMonitor Class |
Monitors dynamic SQL execution in applications that use dotConnect for Oracle.
For a list of all members of this type, see OracleMonitor members.
Devart.Common.DbMonitor
Devart.Common.DbMonitorHelper
Devart.Data.Oracle.OracleMonitor
[Visual Basic]
Public Class OracleMonitor
Inherits DbMonitorHelper
Implements IComponent , IDisposable [C#]
public class OracleMonitor : DbMonitorHelper, IComponent , IDisposable To enable monitoring just drop OracleMonitor component to the form and set IsActive property to true. If dbMonitor application has already been started you can see messages and SQL statements that your application executes. For monitoring you need only one OracleMonitor component on any of the forms your application consists of.
For example on how to trap SQL events in your application please refer to description of Devart.Common.DbMonitor.TraceEvent event of DbMonitor.
For monitoring multithreaded applications with dbMonitor tool you have to specify ApartmentState.MTA attribute as shown in the example below.
See also Using dbMonitor topic.
This sample shows how to enable SQL monitoring in console and web applications. To activate monitoring for web applications, a Devart.Data.Oracle.OracleMonitor object may be added to the Application collection at the first load of the default page.
[C#]
// Console application
[MTAThread]
static void Main(string[] args)
{
OracleMonitor myMonitor = new OracleMonitor();
myMonitor.IsActive = true;
...
}
// Web application
void Page_Load(object sender, EventArgs e)
{
if (Application["mon"] == null)
Application.Add("mon", new Devart.Data.Oracle.OracleMonitor() {IsActive = true});
} [Visual Basic]
' Console application
<MTAThread()> _
Sub Main()
Dim myMonitor As OracleMonitor = New OracleMonitor
myMonitor.IsActive = True
...
End Sub
// Web application
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Application("mon") Is Nothing Then
Application.Add("mon", New Devart.Data.Oracle.OracleMonitor() With {.IsActive = True})
End If
End SubOracleMonitor Members | Devart.Data.Oracle Namespace
© 2002 - 2013 Devart. All Rights Reserved.