Skip to content

Commit

Permalink
Merge pull request #317 from DataObjects-NET/master-no-activation-on-…
Browse files Browse the repository at this point in the history
…es-enumeration

No activation on EntitySet enumeration
  • Loading branch information
alex-kulakov authored Apr 11, 2023
2 parents 566de7c + d9a920a commit 83646ed
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog/7.1.0-RC2-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[main] Added support for DefaultExpression within Linq queries
[main] Support for TimeOnly ctors (time parts and ticks) in Linq, except for SQLite and MySQL providers
[main] No Session.Activate() in ToTransactional extension, it affects EntitySet<T> enumeration.
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public void EntitySetInNestedSessionWhenItsOwnerHasAlreadyBeenFetchedInAnotherSe
using (Session.Deactivate()) { // Prevents Session switching check error
Assert.AreSame(null, Session.Current);
foreach (var orderDetail in order.Details) {
Assert.AreSame(order.Details.Session, Session.Current);
Assert.AreSame(order.Details.Session, session);
Assert.AreSame(session, orderDetail.Session);
Assert.AreSame(session, orderDetail.Order.Session);
Assert.AreSame(order, orderDetail.Order);
Expand Down
1 change: 0 additions & 1 deletion Orm/Xtensive.Orm/Orm/TransactionalExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public static IEnumerable<T> ToTransactional<T>(this IEnumerable<T> source, Sess
/// <returns>"Transactional" version of sequence.</returns>
public static IEnumerable<T> ToTransactional<T>(this IEnumerable<T> source, Session session, IsolationLevel isolationLevel)
{
using (session.Activate(true))
using (var tx = session.OpenAutoTransaction(isolationLevel)) {
foreach (var item in source)
yield return item;
Expand Down

0 comments on commit 83646ed

Please sign in to comment.