-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed durability support #317
Comments
Thanks for filing an issue for this request. |
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 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 |
@roji I'm afraid he's correct. Every transaction request (commit, rollback, etc) goes through SqlServer's transaction manager. SqlClient/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs Lines 220 to 236 in a4f18ca
Lines 983 to 1008 in a4f18ca
Lines 1140 to 1141 in a4f18ca
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.The text was updated successfully, but these errors were encountered: