arschr wrote:
If an exception occur, the Transaction will be rolled back and the exception will be thrown.
So if a database constraint is violated, for example, an exception will be thrown?
Is there a way to identify which item in the collection caused the problem?
You'll get an ORMQueryExecutionException, which contains the entity causing the error, UNLESS you did a bulkupdate directly on the db of course. The actual exception is the internal exception stored in that object, so you can rethrow it and catch it again in a specific handler.
Else if nothing was saved in the database without an exception occuring , the result will only be 0.
Can this happen if there are dirty items and no exception is thrown?
No, a transaction is always aborted internally through an exception or you did the abort with Rollback, but then you know what the outcome is