Jump to content

Uncommited transaction


sphinx9999

Recommended Posts

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

Link to comment
Share on other sites

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...!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.