At 2010-09-01 17:03, Aryeh Gregor wrote:
On Wed, Sep 1, 2010 at 2:42 AM, Maciej Jarosegil@wp.pl wrote:
I think it still should be conscious decision and so those functions could use their first... hm... second parameter as the transaction name. For MS SQL you can simply use BEGIN TRANSACTION [name] (I think it would be more natural), for MySQL I guess savepoints should be used.
I'm not sure what you're saying here. Are you suggesting some solution where commit() does not actually always commit the current transaction? If so, as I said, this is a problem because it will cause locks to be held for much too long in some cases.
Not exactly. If you know you can and should commit transaction called for example "article_update" then it's OK. If you want to commit "image_insert_and_update" then it's OK too. If you are making a commit for everything that is started then it doesn't seem OK as pointed out by Platonides in his example.