Project

General

Profile

Actions

Bug #3439

closed

wt-3.3.3 Transaction::~Transaction() throws

Added by Anonymous almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
07/07/2014
Due date:
% Done:

0%

Estimated time:

Description

wt-3.3.3 Transaction::~Transaction() throws exctiption.

1, never throw an exception from a destructor (Meyers96: 58-61), see http://www.gotw.ca/gotw/047.htm

2, when std::uncaught_exception() is true, it maybe throw a NEW exception:

if(impl*->needsRollback* || std::uncaught_exception())

{

try

{

rollback();

}

catch(std::exception&)

{

release();

throw;//std::uncaught_exception() == true, goto here.

}

}

3, follow The Right Solution of GotW #47, Transaction::~Transaction() should call rollback() only if need it.

Let the user call commit(), so it can throw a exception to report error.

Actions #1

Updated by Koen Deforche over 9 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche
  • Target version set to 3.3.4

Hey,

For convenience we will auto-commit transactions. I agree there was a problem in the "no-throw" path, and I've fixed this.

However, the 'gotw #47' is general advise that is well know to us, but does not consider the specific design goal. The mentioned reasons that what we are doing is "The Wrong Solution" simply do not apply (because of the semantics of the transaction object).

Regards,

koen

Actions #2

Updated by Koen Deforche over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF