From 37e3b5eddc419a143a9ca4cf7d3327a05b4e2f0a Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 22 Dec 2017 15:37:00 +0800 Subject: [PATCH] Master Slave Bug --- Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs index eea7a539f..9d92cd5e7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/AdoProvider/AdoProvider.cs @@ -730,7 +730,7 @@ namespace SqlSugar private void SetConnectionEnd(string sql) { - if (this.IsMasterSlaveSeparation && IsRead(sql)) + if (this.IsMasterSlaveSeparation && IsRead(sql)&&this.Transaction==null) { this.Connection = this.MasterConnection; this.Context.CurrentConnectionConfig.ConnectionString = this.MasterConnection.ConnectionString;