@@ -1,7 +1,6 @@ | |||||
using System; | using System; | ||||
using System.Data; | using System.Data; | ||||
using System.Data.SqlClient; | using System.Data.SqlClient; | ||||
using System.Transactions; | |||||
using Dapper; | using Dapper; | ||||
using DotNetCore.CAP; | using DotNetCore.CAP; | ||||
using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
@@ -30,7 +29,6 @@ namespace Sample.Kafka.MySql.Controllers | |||||
[Route("~/adonet/transaction")] | [Route("~/adonet/transaction")] | ||||
public IActionResult AdonetWithTransaction() | public IActionResult AdonetWithTransaction() | ||||
{ | { | ||||
//NOTE: Add `IgnoreCommandTransaction=true;` to your connection string, see https://github.com/mysql-net/MySqlConnector/issues/474 | |||||
using (var connection = new SqlConnection(Startup.ConnectionString)) | using (var connection = new SqlConnection(Startup.ConnectionString)) | ||||
{ | { | ||||
using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false)) | using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false)) | ||||
@@ -11,7 +11,7 @@ namespace Sample.RabbitMQ.MySql | |||||
public class AppDbContext : DbContext | public class AppDbContext : DbContext | ||||
{ | { | ||||
public const string ConnectionString = "Server=192.168.10.110;Database=testcap;UserId=root;Password=123123;IgnoreCommandTransaction=true;"; | |||||
public const string ConnectionString = "Server=192.168.10.110;Database=testcap;UserId=root;Password=123123;"; | |||||
public DbSet<Person> Persons { get; set; } | public DbSet<Person> Persons { get; set; } | ||||
@@ -28,7 +28,6 @@ namespace Sample.RabbitMQ.MySql.Controllers | |||||
[Route("~/adonet/transaction")] | [Route("~/adonet/transaction")] | ||||
public IActionResult AdonetWithTransaction() | public IActionResult AdonetWithTransaction() | ||||
{ | { | ||||
//NOTE: Add `IgnoreCommandTransaction=true;` to your connection string, see https://github.com/mysql-net/MySqlConnector/issues/474 | |||||
using (var connection = new MySqlConnection(AppDbContext.ConnectionString)) | using (var connection = new MySqlConnection(AppDbContext.ConnectionString)) | ||||
{ | { | ||||
using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false)) | using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false)) | ||||