ITransaction exposes an Enlist method to which you can pass your IDbCommand object.
In other words:
Code:
ITransaction tx = session.BeginTransaction();
try
{
AnObject obj = (AnObject)session.Get(typeof(AnObject), 1)
obj.SomeProperty = "new value";
SqlCommand sqlCmd = new SqlCommand();
sqlCmd.Connection = session.Connection;
sqlCmd.CommandText = "UPDATE MyTable SET MyField = "MyNewValue";
tx.Enlist(sqlCmd); //This is it...
sqlCmd.ExecuteNonQuery();
tx.Commit()
}
catch(Exception)
{
tx.Rollback;
throw;
}
Hope that helps.
Symon.