Fixed
Details
Details
Assignee
Alex Zaytsev
Alex ZaytsevReporter
RoryR
RoryRLabels
Components
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created July 4, 2013 at 1:27 AM
Updated February 20, 2019 at 8:13 PM
Resolved February 20, 2019 at 8:13 PM
EXPECTED:
Setting "command_timeout" in the Configuration properties affects commands created from the so configured session factory.
OBSERVED:
Setting "command_timeout" in the Configuration has no effect when using SqlClientBatchingBatcher, and instead the command timeout is read from the global Envrionment.Properties values.
Rationale:
Setting defined properties on a per-Configuration basis should affect the outcome of dependent factories created from the Configuration instance. This is just the least surprising thing to do, since that is the purpose of the Configuration object. Since an IBatcherFactory is created from a SessionFactory, it should obey the same configuration, not exclusively the global configuration. Other developers have discovered the same problem independently (http://ronaldrosiernet.azurewebsites.net/Blog/2013/04/20/timeout_in_nhibernate_batched_sessions)
Notes to implementors:
It would seem to me that SessionFactory.CreateBatcherFactory should do some detection on the ctor of the IBatcherFactory implementation, or else have some kind of Init method which gets the Settings instance down to the batcher factory on a per-sessionfactory basis. The IBatcherFactory could then pass the Settings instance down to the actual IBatcher which can make use of the configured properties.