Skip to content

Flushing audit data during BeforeTransactionCompletion is forbidden in some cases since NH 5 #7

Closed
@IwanowM

Description

@IwanowM

According to nhibernate-reference

As of NHibernate v5.0, using transaction scope and trying to use the session connection within AfterTransactionCompletion is forbidden and will raise an exception. If the setting transaction.use_connection_on_system_prepare is false, it will forbid any connection usage from BeforeTransactionCompletion event too, when this event is triggered by a transaction scope commit or rollback.

But, as we can see here AuditProcessManager.cs, only one way to flush audit data is inside BeforeTransactionCompletion.
Now it leads to throwing NHibernate.HibernateException Connection usage is currently disallowed

So, it looks like, we have to serve opportunity of flushing audit data on NH session flush.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions