Hi,
> Couldn't a SAVEPOINT command be injected instead, with a RELEASE > SAVEPOINT on success and ROLLBACK TO SAVEPOINT on error? Of course now > the driver has to be aware of any current transaction to know it's to > use savepoints instead of a whole transaction... > Transaction safety should always be guaranteed in the application code, not in the driver. The driver cannot know how transactions are handled by the user, whether the underlying tables even support transactions, or what the specific application logic requires. Adding transaction logic into the driver leads to unpredictable state management. For example, if the driver were to automatically issue a RELEASE SAVEPOINT, the application would lose the ability to roll back the execute_many operation as part of its own broader error-handling logic. > > At which point the recommendation to users to wrap bulk executions in > such commands is ineffective anyway. But if they're using a > nontransactional engine they should already be aware of these pitfalls. > Exactly! /Georg -- Georg Richter, Staff Software Engineer Client Connectivity MariaDB Corporation Ab
