private static void InnerExecuteQuery <T>(GenericRecordList <T> rl, IDbCommand command, string description, bool transformParameters) where T : ITypedRecord <T> { IDbCommand cmd = ADOAdaptersUtils.GetADOCommand(command); IDatabaseAccessProvider provider = DatabaseAccess.GetProviderForTransaction(cmd.Transaction); provider.ExecuteQuery(new ManagedCommand(provider.TransactionManager, cmd), rl, description, transformParameters, false); }
public void ExecuteQuery <T>(Command cmd, GenericRecordList <T> rl, string description, bool transformParameters, bool skipLog) where T : ITypedRecord <T> { DateTime startTime = DateTime.Now; rl.Reader = cmd.ExecuteReader(description, true, transformParameters, true); if (!skipLog) { Command.LogSlowQuery(startTime, description, true); } }
public void ExecuteQuery <T>(Command cmd, GenericRecordList <T> rl, string description, bool transformParameters, bool skipLog) where T : ITypedRecord <T> { var startTime = DateTime.Now; var reader = cmd.ExecuteReader(description, true, transformParameters, true); rl.Reader = reader; // Making sure all readers associated with RecordLists are also associated // with their transaction (so they are disposed during FreeupResources). TransactionManager.AssociateReader(cmd.DriverCommand.Transaction, reader); if (!skipLog) { cmd.LogSlowQuery(startTime, description, true); } }
/// <summary> /// Executes a query using this provider's transaction manager and associates it to a given record list. /// This should be used for fetching results in batches to a record list (e.g. simple and advanced queries). /// </summary> /// <param name="cmd">The command to execute</param> /// <param name="rl">Record list to associate with the data reader</param> /// <param name="description">Brief description of the query, for audit</param> public void ExecuteQuery <T>(Command cmd, GenericRecordList <T> rl, string description) where T : ITypedRecord <T> { ExecuteQuery(cmd, rl, description, false, false); }
public static void NewExecuteSimpleQuery <T>(GenericRecordList <T> rl, IDbCommand cmd, string description) where T : ITypedRecord <T> { InnerExecuteQuery(rl, cmd, description, false); }