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
https://forums.phpfreaks.com/topic/96686-uncommited-transaction/
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...!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.