custom/extra database with nhibernate

Topics: General, Writing modules
Mar 22, 2011 at 12:21 PM


I've got a custom module, which I'd like to use to persist some data outside of the orchard db.

I was trying to use nhibernate independantly from the orchard repository pipeline (ie using my own custom session factories/repositories etc), but it keeps blowing up with transaction errors.

Whats the best way to persist data to another custom db that is not the orchard one ? Can the orchard repository stuff be configured to persist against another db ?

Any help most appreciated


Mar 22, 2011 at 2:21 PM

can you please post call stack and exact error message?

you may try to enable and configure Distributed Transation Coordinator service (just a guess, it helps in some scenarios)


Mar 22, 2011 at 6:53 PM

This looks very much like this issue:

Mar 22, 2011 at 10:03 PM

Yep, thats the same issue as workitem 17291.

Using SQLEXPRESS with DTC turned on does fix it, but I can't turn that on for our deployed servers.

Mar 23, 2011 at 9:00 AM

When you access second database NHibernate tries to enlist distributed transaction because it is the only way to make sure all changes are done or non at all. Is there a way to tell NHibernate to start new transaction when woking with your data tables instead to reuse existing one?