But how I do this? I need the command uses same transaction of the NHibernate.
I tried use another transaction, but if I try to create another transaction I get:
Code:
SqlConnection does not support parallel transactions.
Because I already had initiated the transaction of the NHibernate before.
I tried this too:
Code:
ITransaction trans = this.GetSession().BeginTransaction();
IQuery query = this.GetSession().CreateSQLQuery(sql, returnAlias, returnClass);
query.List();
this.GetSession().SaveOrUpdate(obj1);
this.GetSession().SaveOrUpdate(obj2);
trans.Commit();
But I get:
Code:
SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.
In this way the sql script executes, but the alterations that I make in objects not.
[]'s
Rodrigo C. A.