Open rgroenewoudt opened 5 years ago
Thanks for filing an issue for this request. We'll investigate and see if we can support it sometime in future.
Here are the two pieces that appear to be relevant.
//Pre-20005
// For Transactions
public const string TRANS_BEGIN = "BEGIN TRANSACTION";
public const string TRANS_COMMIT = "COMMIT TRANSACTION";
public const string TRANS_ROLLBACK = "ROLLBACK TRANSACTION";
public const string TRANS_IF_ROLLBACK = "IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION";
public const string TRANS_SAVE = "SAVE TRANSACTION";
//2005 and later
internal enum TransactionManagerRequestType
{
GetDTCAddress = 0,
Propagate = 1,
Begin = 5,
Promote = 6,
Commit = 7,
Rollback = 8,
Save = 9
};
Looking at the TDS spec I don't see anything about DELAYED_DURABILITY in the transaction manager section.
This means that it will need custom handling for DELAYED_DURABILITY. Instead of calling _parser.TdsExecuteTransactionManagerRequest
, it will need to call _parser.TdsExecuteSQLBatch
.
Threading this through is going to be quite difficult, which probably explains why no one has taken up the ticket.
Shouldn't this be added to the TDS spec and forwarded to the SQL Server team?
@Grauenwolf aren't normal and distributed ("transaction manager") transactions being confused above? Delayed durability transactions don't seem to be very relevant for distributed transactions (where they always seem to be fully durable, see table).
In other words, isn't this simply about adding an option to the SqlTransction.Commit API which would cause SqlClient to send COMMIT WITH (DELAYED_DURABILITY = ON)
?
@roji I'm afraid he's correct. Every transaction request (commit, rollback, etc) goes through SqlServer's transaction manager.
And currently transaction manager request lacks a field to pass DELAYED_DURABILITY.
Is your feature request related to a problem? Please describe.
SQL Server 2014 supports delayed durability. This requires a slight different SQL for the commit:
COMMIT WITH (DELAYED_DURABILITY = ON)
Describe the solution you'd like
A property in SqlTransaction, for example bool DelayedDurability
Describe alternatives you've considered
Manually executing the SQL
BEGIN TRANSACTION
andCOMMIT
is the alternative but it would be nice if it's builtin.