Flush all sessions participating in a transaction

Description

With NH-4003, a transaction sharing mechanism between sessions has been introduced. It works by opening new sessions from another one, while using the Connection() option on the session builder.

When committing the NHibernate transaction with FlushMode.Commit, only the originating session get flushed. The other sessions should be flushed too.

Environment

None

Activity

Show:

Frédéric Delaporte 
June 20, 2017 at 10:38 AM

There is the flush order which needs to be chosen.

It looks to me sensible to first flush the sessions having "inherited" their connection manager, in the order they were created. Then flush the originating session.

The originating session must have a longer life span than all other sessions, because it stays responsible for the connection manager. Closing it before other sessions renders them un-usable. That is why it looks to me sound to flush it last.

If the way the user uses the sessions causes him to need another flush order, he will have to manually issue them.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created June 20, 2017 at 10:33 AM
Updated August 25, 2017 at 11:32 AM
Resolved August 25, 2017 at 11:32 AM
Who's Looking?