destructor of transaction class throws an exception
Closed this issue · 1 comments
janushk commented
The problem is that in at least current SQLite documentation is stated that:
COMMIT is an an alias to END TRANSACTION
and SQLite does not support nested transaction
now the code in destructor is:
transaction::~transaction() {
commit(); // effectively sends COMMIT
end(); // sends END TRANSACTION
}
It effectively tries to end transaction twice as it was a nested transaction. SQlite team also probably don't want to make possible an assumption that it is safe to execute END TRANSACTION twice because in future versions of SQLite when nested transactions would be supported it will break existing code.
With regards,
Janusz Korczak