Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-3731

Unable to serialize session after modifying the index of entities in a list

    Details

      Description

      1. Map an entity that contains a collection of child entities as list.
      2. Reorder some child entries in the list or remove one, so that the later ones need to get a new index.
      3. Flush the session and commit the transaction, but don't close the session.
      4. Try to serialize the session.

      This results in the following exception:
      System.InvalidOperationException : Cannot serialize a Session while connected

      The message of the exception is wrong. The session isn't connected. The real problem is that the AbstractBatcher still has entries in the _commandsToClose list and therefore returns true in the HasOpenResources property, which causes the ConnectionManager to return false in the IsReadyForSerialization property.

      This is a regression in NHibernate 4.0 and is caused by NH-3072 Closed . To be more specific, the removal of the "if (st == null)" condition caused it. Since this was a pull request from me, I'd like to not just revert it without understanding what happens first.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                hazzik Alexander Zaytsev
                Reporter:
                cremor cremor
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?