Exemple #1
0
 public virtual void Close()
 {
     if (RealObjectServer != null)
     {
         RealObjectServer.Close();
     }
 }
Exemple #2
0
 public virtual ITransaction CycleTransaction(bool commit = true)
 {
     if (RealObjectServer == null)
     {
         throw new InvalidOperationException("ObjectServer not initialized. RealObjectServer is null.");
     }
     if (_inCycleTransaction)
     {
         throw new SopException("Sop.ObjectServer CycleTransaction is already ongoing, 'making another call fails.");
     }
     lock (this)
     {
         if (_inCycleTransaction)
         {
             throw new SopException("Sop.ObjectServer CycleTransaction is already ongoing, 'making another call fails.");
         }
         _inCycleTransaction = true;
         var t = RealObjectServer.CycleTransaction(commit);
         if (t != null && ((Sop.Transaction.Transaction)t).Server != RealObjectServer)
         {
             RealObjectServer = ((Sop.Transaction.Transaction)t).Server;
         }
         _inCycleTransaction = false;
         return(t);
     }
 }
Exemple #3
0
 /// <summary>
 /// Begin a new Transaction.
 /// </summary>
 /// <returns></returns>
 public virtual Sop.ITransaction BeginTransaction()
 {
     if (RealObjectServer == null)
     {
         throw new InvalidOperationException("ObjectServer not initialized. RealObjectServer is null.");
     }
     return(RealObjectServer.BeginTransaction());
 }
Exemple #4
0
 public virtual void Flush()
 {
     if (RealObjectServer == null)
     {
         throw new InvalidOperationException("ObjectServer not initialized. RealObjectServer is null.");
     }
     RealObjectServer.Flush();
 }
Exemple #5
0
 public virtual IFile GetFile(string name)
 {
     if (RealObjectServer == null)
     {
         throw new InvalidOperationException("ObjectServer not initialized. RealObjectServer is null.");
     }
     return(RealObjectServer.GetFile(name));
 }
Exemple #6
0
 public virtual void Dispose()
 {
     if (RealObjectServer != null)
     {
         RealObjectServer.Dispose();
         StoreFactory.RemoveServerStoresInMru(RealObjectServer);
         RealObjectServer = null;
     }
 }
Exemple #7
0
 /// <summary>
 /// Rollback the Transaction
 /// </summary>
 public virtual void Rollback()
 {
     if (RealObjectServer == null)
     {
         throw new InvalidOperationException("ObjectServer not initialized. RealObjectServer is null.");
     }
     lock (this)
     {
         RealObjectServer.Rollback();
     }
 }