silverqx / TinyORM

Modern C++ ORM library
https://www.tinyorm.org
MIT License
231 stars 25 forks source link

DB::beginTransaction assert()-ing #40

Open SchaichAlonso opened 11 months ago

SchaichAlonso commented 11 months ago

Currently, TinyORM is asserting no other transaction on the same connection is in partially commited state when beginTransaction is invoked.

However, the Q_ASSERT statements are disabled when QT_NO_DEBUG is defined during compilation, i.e. when compiling in release mode. If TinyORM needs it's consumers to explicit distinction between top level transactions and truely nested transactions / savepoints, exceptions provide a more reliable error handling mechanism then assertions do

silverqx commented 11 months ago

This is true, this is one of the first code I wrote and it should be completely refactored to exceptions, i know about this here .