This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // /* | |
| // DatabaseCopyEngine.cs | |
| // Copyright 2013 Gibraltar Software, Inc. | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #region File Header | |
| // /* | |
| // EventQueueDispatcher.cs | |
| // Copyright 2013 Gibraltar Software, Inc. | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Guid[] logEventIds; | |
| using (IDbContext ctx = repository.GetContext()) | |
| { | |
| // find all session events that have changed since we last processed | |
| logEventIds = ctx.Set<LogEvent>().AsNoTracking() | |
| .OrderBy(e => e.LastOccurrence.Date) | |
| .Select(e => e.Id) | |
| .ToArray(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Create a new context with the specified named connection string from the application configuration | |
| /// </summary> | |
| /// <param name="connectionStringName"></param> | |
| public RamsCore(string connectionStringName) | |
| : base("name=RamsCore") | |
| { | |
| if (string.IsNullOrWhiteSpace(connectionStringName)) | |
| throw new ArgumentNullException("connectionStringName", "The name of a standard connection string in the config file must be supplied"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Check every stinkin' session event to see if they're affected by the latest redaction rules | |
| /// </summary> | |
| public void ProcessRedactionRuleChange(CentralRepository repository) | |
| { | |
| Log.Write(LogMessageSeverity.Information, LogCategory, "Checking existing session events for candidates to update based on newest redaction rules", | |
| "We will check the caption of the log event for each session event to determine if it may be affected by a redaction rule and if so queue it to be recalculated."); | |
| //we need to be ready for millions and millions of log events, all of which could match.. So we have to | |
| //be cautious about memory and locks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Delegate_Perf_Test | |
| { | |
| [TestFixture] | |
| public class Delegate_Performance_Comparision | |
| { | |
| [Test] | |
| public void MeasureDelegate() | |
| { | |
| int n = 50000000; | |
| Action<int> d = MethodNoInlining; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Synchronously execute the provided request. | |
| /// </summary> | |
| /// <param name="newRequest"></param> | |
| /// <param name="maxRetries">The maximum number of times to retry the connection. Use -1 to retry indefinitely.</param> | |
| public void ExecuteRequest(IWebRequest newRequest, int maxRetries) | |
| { | |
| if (newRequest == null) | |
| throw new ArgumentNullException("newRequest"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Examines exceptions for possible retry scenarios. | |
| /// </summary> | |
| public static DatabaseErrorCategory ResolveErrorCategory(SqlException ex) | |
| { | |
| bool isConnectionError = false; | |
| bool isDeadlockError = false; | |
| bool isTimeoutError = false; |