MySQL Forums
Forum List  »  Newbie

Transaction Question - Permanent locking problem
Posted by: alex Lewis
Date: June 12, 2005 07:04AM

Two questions about transactions in MySQL.
I am in particular using BDB (BerkeleyDB) tables. and sending statements via PHP. I do not have shell access.
Using PHP - 4.3.10
using MYSQL - 3.23.56

1)
If several users were accessing the MySQL database at the same time (User 1, User 2, User 3)
If User 1 starts a transaction :
> BEGIN;

But before User 1 COMMITS their transaction to the DB, User 2 issues a COMMIT statement
> COMMIT;

Will the locking started when User 1 started the transaction prevent User 2 from doing this Or Will the COMMIT statement actually inadvertently COMMIT User 1's statements before he/she is ready to COMMIT.



2)
If I start a transaction
> BEGIN;

And before i send the COMMIT statement - the application sending the statements goes faulty and stops sending the statements. The database gets stuck inside the transaction.

As the application is faulty there is no chance of sending a rollback statement. Is there a way of telling the MySQL database via the statements sent in PHP to rollback the transaction if not COMMIT or ROLLBACK is sent and the database becomes locked.

At the moment - all my tables seem to lock up after a begin statement. And if COMMIT or ROLLBACK is never sent then all users are locked out for at least 10 mins (thats only as far as i have timed it - it could be a permanent lock out)

Options: ReplyQuote


Subject
Written By
Posted
Transaction Question - Permanent locking problem
June 12, 2005 07:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.