I have the following pseudo-code
try
{
beginTrans();
//do some database opertions...
//PointA
//do some database opertions...
commit();
}
catch (const AnyDbException& ex)
{
rollback();
//error logging...
}
In above code, everything looks OK. How ever, if there is a non-database related exception thrown, it will not be caught in the catch, and the transaction is NOT committed either.
If I use catch(...), it will catch anything but in that case I will prefer to not to catch it as it should be caught outside.
What can I do?