IHibernateOperations.Execute(HibernateDelegate) Method

Parameters

del

The delegate callback object that specifies the Hibernate action.

Return Value

a result object returned by the action, or

null

Remarks

Application exceptions thrown by the action object get propagated to the caller (can only be unchecked). Hibernate exceptions are transformed into appropriate DAO ones. Allows for returning a result object, i.e. a domain object or a collection of domain objects.

Note: Callback code is not supposed to handle transactions itself! Use an appropriate transaction manager like HibernateTransactionManager. Generally, callback code must not touch any Session lifecycle methods, like close, disconnect, or reconnect, to let the template do its work.