I'm sorry, obviously this post should be in "generated code"... I clicked too fast I guess
I have code like this:
try {
unitOfWork.Commit( transaction );
transaction.Commit();
} catch ( SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException ex ) {
transaction.Rollback();
// error messages and stuff...
}
Whenever an update (called by the unitOfWork) causes an ORMQueryExecutionException to be thrown it doesn't get "catched" by my code (at first), but instead the Visual Studio Exception Assistant pops up with the line causing the exception marked GREEN (instead of the usual yellow). This particular line is in the EntityBase class:
protected override bool InsertEntity()
{
DienstboekDAO dao = (DienstboekDAO)CreateDAOInstance();
return dao.AddNew(base.Fields, base.Transaction); // <--- this one causes the exception
}
But I can click "continue". When I do that my code catches the exception as it should and rolls back the transaction.
When I build my app with the "release solution config" it all works fine, but it is very annoying when debugging and I can't help but think that this should not be happening, so in other words, that I made a mistake somewhere.
To be clear: I expect the Exception to be thrown, because I was testing the rollback and error messages. So my question isn't about WHY the exception is thrown, I know that (I try to insert a duplicate primary key), but my question is; why does the exeption first get caught by the Exception Assistant and later by my own catch block?
I'm using Visual Studio 2005 (.NET 2.0) and
SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll version 1.0.2005.1
with an Access database.