Пример #1
0
 public static SqlTransaction InitiateSharedTransaction(object source)
 {
     Monitor.Enter(SharedConnection);
     try
     {
         if (SharedConnection.State != System.Data.ConnectionState.Open)
         {
             SharedConnection.Open();
             SharedTransaction = SharedConnection.BeginTransaction();
             initialSource     = source;
         }
     }
     finally
     {
         Monitor.Exit(SharedConnection);
     }
     return(SharedTransaction);
 }