Skip to content

Commit 0ad47f4

Browse files
committed
remove repeat EnsureDataSource
1 parent e61249a commit 0ad47f4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/SmartSql.Test.Performance/Maps/AllPrimitive.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,14 @@
175175
</IsNotEmpty>
176176
</Where>
177177
</Statement>
178+
<Statement Id="GetByPage_ValueTuple">
179+
Select T.* From T_AllPrimitive T With(NoLock)
180+
<Include RefId="QueryParams" />
181+
Order By T.Id Desc
182+
Offset ((@PageIndex-1)*@PageSize) Rows Fetch Next @PageSize Rows Only;
183+
184+
Select Count(1) From T_AllPrimitive T
185+
<Include RefId="QueryParams" />;
186+
</Statement>
178187
</Statements>
179188
</SmartSqlMap>

src/SmartSql/DbSession/DefaultDbSession.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ public void BeginTransaction()
121121
{
122122
_logger.LogDebug("BeginTransaction.");
123123
}
124-
EnsureDataSource();
125124
Open();
126125
Transaction = Connection.BeginTransaction();
127126
TransactionBegan?.Invoke(this, DbSessionEventArgs.None);
@@ -145,7 +144,6 @@ public void BeginTransaction(IsolationLevel isolationLevel)
145144
{
146145
_logger.LogDebug("BeginTransaction.");
147146
}
148-
EnsureDataSource();
149147
Open();
150148
Transaction = Connection.BeginTransaction(isolationLevel);
151149
TransactionBegan?.Invoke(this, DbSessionEventArgs.None);

0 commit comments

Comments
 (0)