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
精彩评论