- Timestamp:
- 06/19/10 09:17:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/sources/HeuristicLab.Hive.Server/3.2/ServiceCallInterception.cs
r3578 r3931 16 16 17 17 public object Invoke(IMethodInvocation invocation) { 18 DateTime start = DateTime.Now; 18 19 Logger.Info("Entering Method: " + invocation.Method.Name); 19 20 20 if( ContextFactory.Context != null) {21 if(!ContextFactory.IsContextNull()) { 21 22 Logger.Info("Not null context found - why wasn't this disposed?"); 22 23 try { … … 28 29 ContextFactory.Context = null; 29 30 } 30 31 Logger.Info("Context info: Timeout: " + ContextFactory.Context.Connection.ConnectionTimeout + " | " + 32 ContextFactory.Context.Connection.State + " | Conn: " + ContextFactory.Context + " | HashCode is: " + ContextFactory.Context.Connection.GetHashCode()); 31 33 Object obj = null; 32 34 33 if (invocation.Method.Name.Equals("SendStreamedJob") || invocation.Method.Name.Equals("StoreFinishedJobResultStreamed")) {35 /*if (invocation.Method.Name.Equals("SendStreamedJob") || invocation.Method.Name.Equals("StoreFinishedJobResultStreamed")) { 34 36 ContextFactory.Context.Connection.Open(); 35 37 if(UseTransactions) { … … 48 50 ContextFactory.Context = null; 49 51 } 50 } else { 52 } else { */ 51 53 if(UseTransactions) { 52 54 using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) { … … 57 59 } 58 60 catch (Exception e) { 59 Logger.Error("Exception occured during method invocation", e); 61 Logger.Error("Exception occured during method invocation", e); 62 Logger.Error("Inner Exception: ", e.InnerException); 60 63 } 61 64 finally { … … 80 83 } 81 84 } 85 //} 86 TimeSpan ts = DateTime.Now - start; 87 if (ts.Seconds > 2) { 88 Logger.Warn("Invocation took: " + ts); 89 } else if (ts.Seconds > 10) { 90 Logger.Error("Invocation took: " + ts); 91 } else { 92 Logger.Info("Invocation took: " + ts); ; 82 93 } 83 94 Logger.Info("Leaving Method: " + invocation.Method.Name); 84 95 85 96 return obj; 86 97 }
Note: See TracChangeset
for help on using the changeset viewer.