开发者

Is it possible to set the fetch size for NHibernate?

开发者 https://www.devze.com 2023-02-06 20:51 出处:网络
When retrieving rows from an oracle database using ODP.NET, I can specify the FetchSize parameter, which is the number of bytes that will be retrieved in one round-trip to the database.

When retrieving rows from an oracle database using ODP.NET, I can specify the FetchSize parameter, which is the number of bytes that will be retrieved in one round-trip to the database.

Is it possible to set a FetchSize (or equivalent) for NHibernate? If so, how is this done?

If not, is there a开发者_StackOverflow default size that it retrieves?

Thanks!


Subclass NHibernate.Driver.OracleDataClientDriver and override CreateCommand:

public override IDbCommand CreateCommand()
{
    var command = (OracleCommand)base.CreateCommand();
    command.FetchSize = desiredValue;
    return command;
}


For completeness, you can also set this in the registry or in the machine.config, web.config, or app.config:

http://download.oracle.com/docs/html/E10927_01/featConfig.htm

0

精彩评论

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

关注公众号