Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DistributedLock.Oracle/OracleDatabaseConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ private OracleDatabaseConnection(IDbConnection connection, bool isExternallyOwne
// from https://docs.oracle.com/html/E10927_01/OracleCommandClass.htm "this method is a no-op" wrt "Prepare()"
public override bool ShouldPrepareCommands => false;

public override bool IsCommandCancellationException(Exception exception) =>
public override bool IsCommandCancellationException(Exception exception) =>
exception is OracleException oracleException
// based on https://docs.oracle.com/cd/E85694_01/ODPNT/CommandCancel.htm
&& (oracleException.Number == 01013 || oracleException.Number == 00936 || oracleException.Number == 00604);

public override async Task SleepAsync(TimeSpan sleepTime, CancellationToken cancellationToken, Func<DatabaseCommand, CancellationToken, ValueTask<int>> executor)
{
using var sleepCommand = this.CreateCommand();
sleepCommand.SetCommandText("BEGIN sys.DBMS_SESSION.SLEEP(:seconds) END;");
sleepCommand.SetCommandText("BEGIN sys.DBMS_SESSION.SLEEP(:seconds); END;");
sleepCommand.AddParameter("seconds", sleepTime.TotalSeconds);

try
Expand Down