<PackageReference Include="Relativity.Server.Utility.SDK" Version="14.2.7" />

kCura.Data.RowDataGateway.Helper

public sealed class Helper
public static void CloseDataReader(DbDataReader reader)

Closes the provided DbDataReader.

public static void CloseSqlDataReader(SqlDataReader reader)

public static Exception CombineExceptions(Exception finalException, IEnumerable<Exception> otherExceptions)

Creates a deadlock exception based on the final exception and the other exceptions that occurred while retrying the deadlock.

public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID)

Deletes from the provided table the artifact id if it exists in the provided foreign key id column.

public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, string prefix)

Deletes from the provided table the artifact id if it exists in the provided foreign key id column.

public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, bool checkTableExistence)

Deletes from the provided table the artifact id if it exists in the provided foreign key id column.

public static void DeleteFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, bool checkTableExistence, string prefix)

Deletes from the provided table the artifact id if it exists in the provided foreign key id column.

public static void DeleteFromTableByForeignKeyIDs(BaseContext context, string tableName, string foreignKeyID1Name, int foreignKeyID1, string foreignKeyID2Name, int foreignKeyID2)

public static void DeleteFromTableByForeignKeyValue(BaseContext context, string tableName, string foreignKeyValueName, string foreignKeyValue)

public static void DeleteMultipleFromTableByForeignKeyGuid(BaseContext context, string tableName, string foreignKeyIDName, List<Guid> foreignKeyIDs, string prefix = "")

Deletes the rows corresponding to the provided guid(s) if they exists in the provided foreign key id column of the provided table.

public static void DeleteMultipleFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, string commaSeparatedListOfIDs)

Deletes the rows corresponding to the provided artifact id(s) if they exists in the provided foreign key id column of the provided table.

public static void DeleteMultipleFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, string commaSeparatedListOfIDs, int timeoutValue)

Deletes the rows corresponding to the provided artifact id(s) if they exists in the provided foreign key id column of the provided table.

public static int ExecuteNonQuerySQLStatementRemotely(string sqlStatement, IEnumerable<SqlParameter> parameters, BaseContext context, RemoteDatabaseContext remoteDbContext)

Executes a SQL statement against a remote SQL server that does not return data, using the provided set of parameters, context, and remote context. Uses ConnectTimeout as its timeout.

public static int ExecuteNonQuerySQLStatementRemotely(string sqlStatement, IEnumerable<SqlParameter> parameters, int timeoutValue, BaseContext context, RemoteDatabaseContext remoteDbContext)

Executes a SQL statement against a remote SQL server that does not return data, using the provided set of parameters, timeout, context, and remote context.

public static int ExecuteNonQueryWaitForDeadlocks(SqlCommand command)

Attempts to execute the specified command and retries up to NumberOfTriesOnDeadlock times if the command errors out with a deadlock error. Note that this method should not be used for any command used in the scope of a transaction as the transaction is abandoned after a deadlock is encountered.

public static Task<int> ExecuteNonSqlQueryRetryOnDeadlockAsync(Func<Task<int>> func, CancellationToken cancelToken)

Executes the provided function NumberOfTriesOnDeadlock times, using the provided cancellation token.

public static bool ExistsByForeignKey(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID)

public static void FillDataAdapterWaitForDeadlocks(SqlDataAdapter dataAdapter, DataTable dataTable)

Fills the data table using the data adapter. The data adapter should not have a transaction as the transaction is abandoned after a deadlock is encountered.

public static void FillDataAdapterWaitForDeadlocks(SqlDataAdapter dataAdapter, DataSet dataSet)

Attempts to execute the specified command to fill the provided dataSet with the provided dataAdapter and retries up to NumberOfTriesOnDeadlock times if the command errors out with a deadlock error. Note that this data adapter should not be used for any command used in the scope of a transaction as the transaction is abandoned after a deadlock is encountered.

public static string GetRemoteDatabasePrepend(RemoteDatabaseContext remoteDbContext)

Wraps RemoteDatabasePrependString, using the server and database name of the provided RemoteDatabaseContext.

public static string GetRemoteDatabasePrepend(string serverName, RemoteDatabaseContext remoteDbContext)

Gets the remote database prepend to use for sql commands against the provided server with the provided RemoteDatabaseContext.

public static string GetRemoteDatabasePrependForDbo(RemoteDatabaseContext remoteDbContext)

Wraps RemoteDatabasePrependStringForDboUser, using the server and database name of the provided RemoteDatabaseContext.

public static string GetSchemaLessRemoteDatabasePrepend(string serverName, RemoteDatabaseContext remoteDbContext)

Gets the remote database prepend without a schema to be used for sql commands against the provided server with the provided RemoteDatabaseContext.

public static bool IsAzureSqlTransientError(Exception ex)

public static bool IsCancelledEvent(Exception ex)

public static bool IsConnectionTimeout(Exception ex)

public static bool IsDeadLock(Exception ex)

Indicates whether the provided exception indicates a deadlock scenario.

public static bool IsExecutionTimeout(Exception ex)

public static bool IsQueryHintError(Exception ex)

public static bool IsTemporaryIssue(Exception ex)

public static bool IsTimeout(Exception ex)

public static void RemoveFromTableByForeignKeyID(BaseContext context, string tableName, string foreignKeyIDName, int foreignKeyID, string prefix = "")

Updates, to null, the row corresponding to the provided artifact id if it exists in the provided foreign key id column of the provided table.

public static void ThrowWrappedException(Exception ex, string executedSQL)

public static void ThrowWrappedException(Exception ex, string executedSQL, IEnumerable parameters)

public static Guid ToNullOrGuid(object value)

Attempts to cast the provided value to DBNull. If that fails, attempts to cast the provided value to a Guid.

public static void TruncateTable(BaseContext context, string tableName)