Skip to content

Commit

Permalink
remove repeat EnsureDataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Apr 3, 2019
1 parent e61249a commit 0ad47f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/SmartSql.Test.Performance/Maps/AllPrimitive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,14 @@
</IsNotEmpty>
</Where>
</Statement>
<Statement Id="GetByPage_ValueTuple">
Select T.* From T_AllPrimitive T With(NoLock)
<Include RefId="QueryParams" />
Order By T.Id Desc
Offset ((@PageIndex-1)*@PageSize) Rows Fetch Next @PageSize Rows Only;

Select Count(1) From T_AllPrimitive T
<Include RefId="QueryParams" />;
</Statement>
</Statements>
</SmartSqlMap>
2 changes: 0 additions & 2 deletions src/SmartSql/DbSession/DefaultDbSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ public void BeginTransaction()
{
_logger.LogDebug("BeginTransaction.");
}
EnsureDataSource();
Open();
Transaction = Connection.BeginTransaction();
TransactionBegan?.Invoke(this, DbSessionEventArgs.None);
Expand All @@ -145,7 +144,6 @@ public void BeginTransaction(IsolationLevel isolationLevel)
{
_logger.LogDebug("BeginTransaction.");
}
EnsureDataSource();
Open();
Transaction = Connection.BeginTransaction(isolationLevel);
TransactionBegan?.Invoke(this, DbSessionEventArgs.None);
Expand Down

0 comments on commit 0ad47f4

Please sign in to comment.