Oracle Seq BUG

This commit is contained in:
sunkaixuan
2019-04-23 20:15:43 +08:00
parent 54d857c28f
commit 4eea7d6c6f

View File

@@ -26,8 +26,11 @@ namespace SqlSugar
PreToSql();
string sql = InsertBuilder.ToSqlString();
RestoreMapping();
var isDisableMasterSlaveSeparation = this.Context.Ado.IsDisableMasterSlaveSeparation;
this.Context.Ado.IsDisableMasterSlaveSeparation = true;
var count = Ado.ExecuteCommand(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
var result = (this.GetIdentityKeys().IsNullOrEmpty() || count == 0) ? 0 : GetSeqValue(GetSeqName()).ObjToInt();
this.Context.Ado.IsDisableMasterSlaveSeparation = isDisableMasterSlaveSeparation;
return result;
}
@@ -37,8 +40,11 @@ namespace SqlSugar
PreToSql();
string sql = InsertBuilder.ToSqlString();
RestoreMapping();
var isDisableMasterSlaveSeparation = this.Context.Ado.IsDisableMasterSlaveSeparation;
this.Context.Ado.IsDisableMasterSlaveSeparation = true;
var count = Ado.ExecuteCommand(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
var result = (this.GetIdentityKeys().IsNullOrEmpty() || count == 0) ? 0 :Convert.ToInt64(GetSeqValue(GetSeqName()));
this.Context.Ado.IsDisableMasterSlaveSeparation = isDisableMasterSlaveSeparation;
return result;
}