sphinx9999 Posted March 18, 2008 Share Posted March 18, 2008 Just wondering, anyone know what would happen if I started a transaction, set off some data-intensive queries and then the db connection is lost...? With no commit or rollback specified what will mySQL do? I want: SET AUTOCOMMIT=0; BEGIN; INSERT INTO logquick_backup SELECT *, "2008-03-18 11:22:23" FROM logquick WHERE logtime < '2008-03-17 23:59:59' ORDER BY logtime ASC LIMIT 5000; COMMIT; SET AUTOCOMMIT=1; but what if MySQL only receives: SET AUTOCOMMIT=0; BEGIN; INSERT INTO logquick_backup SELECT *, "2008-03-18 11:22:23" FROM logquick WHERE logtime < '2008-03-17 23:59:59' ORDER BY logtime ASC LIMIT 5000; ? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/96686-uncommited-transaction/ Share on other sites More sharing options...
aschk Posted March 18, 2008 Share Posted March 18, 2008 It'll drop the transaction... because no commit was done. Try it and see At least I believe this to be the behaviour. Quote Link to comment https://forums.phpfreaks.com/topic/96686-uncommited-transaction/#findComment-494783 Share on other sites More sharing options...
sphinx9999 Posted March 18, 2008 Author Share Posted March 18, 2008 It'll drop the transaction... ...Try it and see Thanx, When you say drop the transaction do you mean rollback (i.e. the same outcome as rollback)? I could try it but I'm not sure how long I'd have to wait to find out the result... I assume there will be a timeout but dunno when that'll kick in...! Quote Link to comment https://forums.phpfreaks.com/topic/96686-uncommited-transaction/#findComment-494902 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.