Skip to content

Commit 637d876

Browse files
authored
Add transaction.Commit call in transaction usage doc
1 parent e68c665 commit 637d876

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/content/troubleshooting/transaction-usage.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ using (var connection = new MySqlConnection(...))
4343

4444
// otherwise, this will throw System.InvalidOperationException: The transaction associated with this command is not the connection's active transaction.
4545
command.ExecuteScalar();
46+
47+
transaction.Commit();
4648
}
4749
}
4850
```
@@ -60,6 +62,8 @@ using (var connection = new MySqlConnection(...))
6062

6163
// use this instead:
6264
connection.Query("SELECT ...", transaction: transaction);
65+
66+
transaction.Commit();
6367
}
6468
}
6569
```
@@ -68,4 +72,4 @@ using (var connection = new MySqlConnection(...))
6872

6973
* [MySQL bug 88611](https://bugs.mysql.com/bug.php?id=88611) reporting Connector/NET's behaviour as a bug
7074
* [Issue #333](https://github.com/mysql-net/MySqlConnector/issues/333) for the addition of MySqlConnector's strict behaviour
71-
* Issues [#405](https://github.com/mysql-net/MySqlConnector/issues/405), [#452](https://github.com/mysql-net/MySqlConnector/issues/452), [#457](https://github.com/mysql-net/MySqlConnector/issues/457) for users encountering this as a breaking change
75+
* Issues [#405](https://github.com/mysql-net/MySqlConnector/issues/405), [#452](https://github.com/mysql-net/MySqlConnector/issues/452), [#457](https://github.com/mysql-net/MySqlConnector/issues/457) for users encountering this as a breaking change

0 commit comments

Comments
 (0)