开发者

Query the NHibernate session scope cache - NonUnique Exception

开发者 https://www.devze.com 2023-01-29 23:47 出处:网络
I\'m having a problem in my application when I\'m saving an entity. On occasion I\'d get NonUnique exception on that entity from NHibernate. Now, I know what causes those kind of exceptions and how to

I'm having a problem in my application when I'm saving an entity. On occasion I'd get NonUnique exception on that entity from NHibernate. Now, I know what causes those kind of exceptions and how to deal with them, but since the application codebase is rather large (200K LOC), it's very hard to pinpoint which object it was exactly that caused that error.

What I'd like to do is query or extract somehow all the objects that NHibernate keeps in the session scope cache, so i'd have a better idea of what 开发者_如何学JAVAit was exactly that caused that exception.

Is there a way to do something like that ?


As far as I know there is nothing in ISession to "list" its contents. You could use interceptors or event listeners to track and log your operations though.

0

精彩评论

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