Skip to content

NH-3492 - SqlClientBatchingBatcher incorrectly ignoring per-SessionFactory Settings properties #1158

@nhibernate-bot

Description

@nhibernate-bot

codekaizen created an issue — 4th July 2013, 1:27:58:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions