[openstack-dev] [oslo.db][sqlalchemy] rollback after commit

2015-09-16 Thread Gareth
Hi DB experts, I'm using mysql now and have general log like: 1397 Query SELECT 1 1397 Query SELECT 1397 Query UPDATE 1397 Query COMMIT 1397 Query ROLLBACK I found there always is 'SELECT 1' before real queries and 'COMMIT' and 'ROLLBACK' after. I know 'SELECT 1' is the

Re: [openstack-dev] [oslo.db][sqlalchemy] rollback after commit

2015-09-16 Thread Roman Podoliaka
Hi Gareth, Right, 'SELECT 1' issued at the beginning of every transaction is a pessimistic check to detect disconnects early. oslo.db will create a new DB connection (as well as invalidate all the existing connections to the same DB in the pool) and retry the transaction once [1] ROLLBACK you

Re: [openstack-dev] [oslo.db][sqlalchemy] rollback after commit

2015-09-16 Thread Mike Bayer
On 9/16/15 10:16 AM, Roman Podoliaka wrote: Hi Gareth, Right, 'SELECT 1' issued at the beginning of every transaction is a pessimistic check to detect disconnects early. oslo.db will create a new DB connection (as well as invalidate all the existing connections to the same DB in the pool) and