开发者

NHibernate Linq queries not returning data saved in the same transaction

开发者 https://www.devze.com 2022-12-29 17:04 出处:网络
I have a situation where I am using NHibernate in a WCF service and using a TransactionScope for the transaction management. NHibernate enlists in the ambient transaction fine, but, any changes I make

I have a situation where I am using NHibernate in a WCF service and using a TransactionScope for the transaction management. NHibernate enlists in the ambient transaction fine, but, any changes I make and save inside the transaction, are not visible to any queries I make while still in that transaction. So if I add an entity and session.save() it, then further on in the code, there开发者_运维知识库 is a linq query against that entities table, the entity I just added is not returned.

Strangely this seems to work fine if I use explicit NHibernate transactions in my tests.

Anyone have any ideas as to why and what I can do about it?

Many thanks

Andrew

0

精彩评论

暂无评论...
验证码 换一张
取 消