I need a lot of DB processing done in a single transaction, including some processing using NHibernate.
To make everything work in the same transaction, I'm using NHibernate's Session to start it, and enlist the the commands for the other work in it.
Everything goes OK until I commit. At that time I get a transaction timeout.
How can I set the NHibernate transaction timeout value sufficiently high?
We use FluentNHibernate.
After some trial and lots of error I found this:
It appears that NHibernate takes the "TransactionManager.DefaultTimeout" value.
It can be set via
<system.transactions>
<defaultSettings timeout="01:00:00" />
</system.transactions>
in the app/web config
If it is set to a value higher than TransactionManager.MaximumTimeout the transaction timeout will default to that. If you need longer you can lengthen that time by updating the "machine.config" for your .Net framework version with:
<system.transactions>
<machineSettings maxTimeout="01:00:00" />
</system.transactions>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With