NHibernate 3.0: TransactionScope and Auto-Flushing

后端 未结 4 738
一生所求
一生所求 2021-01-02 18:07

In NHibernate 3.0, FlushMode.Auto does not work when running under an ambient transaction only (that is, without starting an NHibernate transaction). Should it?

4条回答
  •  悲哀的现实
    2021-01-02 18:12

    The answer provided by Diego does not work in the case where you have an oracle database. (releated question). The session.BeginTransaction will fail because the connection is already part of a transaction.

    Looks like we have to write some code around this problem in our application (WCF,NHibernate, Oracle), but it just feels like something that NHibernate should provide out of the box. So if anyone has a good answer, it would be really appreciated.

提交回复
热议问题