Ejemplo n.º 1
0
 /// <summary>
 /// Dispose the connection
 /// </summary>
 public virtual void Dispose()
 {
     OpenedDataReaders.Clear();
     _attachedObjects.Clear();
     Trans?.Dispose();
     SqlConnection?.Dispose();
     Trans         = null;
     SqlConnection = null;
 }
 public static void CleanCachedItems()
 {
     CachedFields.Clear();
     CachedTypes.Clear();
     CachedConstructor.Clear();
     CachedPropertyInfo.Clear();
     CachedDynamicMethod.Clear();
     DefaultConstructor.Clear();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// commit the transaction
 /// </summary>
 public void SaveChanges()
 {
     try
     {
         Trans?.Commit();
     }
     catch
     {
         Rollback();
         throw;
     }
     finally
     {
         OpenedDataReaders.Clear();
         Trans?.Dispose();
         SqlConnection?.Dispose();
         Trans         = null;
         SqlConnection = null;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// commit the transaction
 /// </summary>
 public void SaveChanges()
 {
     try
     {
         Trans?.Commit();
     }
     catch (Exception ex)
     {
         Rollback();
         throw new EntityException(ex.Message);
     }
     finally
     {
         OpenedDataReaders.Clear();
         Trans?.Dispose();
         SqlConnection?.Dispose();
         Trans         = null;
         SqlConnection = null;
     }
 }