Namespaces

Types

Type IBatcher

Namespace NHibernate.Engine

Interfaces IDisposable

Methods

Properties

Public instance methods

void AbortBatch(Exception e)

Must be called when an exception occurs.
Parameters
Exception e

void AddToBatch(IExpectation expectation)

Add an insert / delete / update to the current batch (might be called multiple times for a single PrepareBatchStatement() )
Parameters
IExpectation expectation Determines whether the number of rows affected by query is correct.

void CancelLastQuery()

Cancel the current query statement

void CloseCommand(IDbCommand cmd, IDataReader reader)

Close a IDbCommand opened using PrepareCommand()
Parameters
IDbCommand cmd The IDbCommand to ensure is closed.
IDataReader reader The IDataReader to ensure is closed.

void CloseCommands()

Close any query statements that were left lying around
Use this method instead of Dispose if the IBatcher can be used again.

void ExecuteBatch()

Execute the batch

int ExecuteNonQuery(IDbCommand cmd)

Executes the IDbCommand .
The Batcher is responsible for ensuring that all of the Drivers rules for how many open IDataReader s it can have are followed.
Parameters
return int The number of rows affected.
IDbCommand cmd The IDbCommand to execute.

IDataReader ExecuteReader(IDbCommand cmd)

Gets an IDataReader by calling ExecuteReader on the IDbCommand .
The Batcher is responsible for ensuring that all of the Drivers rules for how many open IDataReader s it can have are followed.
Parameters
return IDataReader The IDataReader from the IDbCommand .
IDbCommand cmd The IDbCommand to execute to get the IDataReader .

IDbCommand PrepareBatchCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes)

Parameters
return IDbCommand
CommandType commandType
SqlString sql
SqlType[] parameterTypes

IDbCommand PrepareCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes)

Parameters
return IDbCommand
CommandType commandType
SqlString sql
SqlType[] parameterTypes

IDbCommand PrepareQueryCommand(CommandType commandType, SqlString sql, SqlType[] parameterTypes)

Parameters
return IDbCommand
CommandType commandType
SqlString sql
SqlType[] parameterTypes

Public properties

bool HasOpenResources get;

Gets the value indicating whether there are any open resources managed by this batcher (IDbCommands or IDataReaders).
return bool