public static void OpenConnection()
{
if (_cnLocks == 0)
DbConnection.Open();
if (DbConnection.State != ConnectionState.Open)
throw new ApplicationException("Assert: Connection is not open");
_cnLocks++;
if (_cnLocks >= (int.MaxValue - 100))
_cnLocks = 1;
}