42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
|
|
namespace SDA.DataProvider
|
|
{
|
|
/// <summary>
|
|
/// Diagnosztikai célokat szolgál.
|
|
/// </summary>
|
|
public static class SDAConnectionDiagnostics
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public static bool DiagnosticEnable { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// <see cref="SDACommand"/> végrehajtása után kiváltodó esemény />
|
|
/// </summary>
|
|
public static event EventHandler<CommandExecutedEventArgs> CommandExecuted;
|
|
|
|
internal static void RaiseCommandExecutedEvent(object sender, CommandExecutedEventArgs transactionEventArgs)
|
|
{
|
|
CommandExecuted?.Invoke(sender, transactionEventArgs);
|
|
}
|
|
|
|
static volatile int _activeConnections;
|
|
|
|
internal static void IncrementActiveConnections()
|
|
{
|
|
_activeConnections++;
|
|
}
|
|
|
|
internal static void DecrementActiveConnections()
|
|
{
|
|
_activeConnections--;
|
|
}
|
|
|
|
/// <summary>
|
|
/// A jelenleg megnyitott, de még nem eldobott adatbázis-kapcsolatok számát adja meg.
|
|
/// </summary>
|
|
public static int ActiveConnections => _activeConnections;
|
|
}
|
|
}
|