Audit not working when using just TransactionScope to manage transactions

Description

My unit of work is using TransactionScope to handle transaction management (since the NHibernate enlists correctly in ambient transactions). During my tests I realized that the audit engine does not work when there's no native NHibernate transaction.

Using just TransactionScope Envers runs just fine but does not log anything (nor throws an exception complaining about no transaction detected). Trying to run without opening TransactionScope (nor ITransaction) Envers throws an exception as there's no transaction going on.

I've made some unit tests to illustrate what I'm trying to say:
https://bitbucket.org/daspn/envers.transactionscope

Please, take a look.

Best regards,
Daniel

Environment

None

Assignee

Roger

Reporter

Daniel Nunes

Labels

Components

Affects versions

Priority

Minor
Configure