Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- MYsql & transactions
August 22, 2005, 10:55 am
rate this thread
I have problem with my MySQL server and transactions. I installed MySQL
server 5.0.11 with MySQL administrator & MySql Query Browser on Win XP
Prof. I would like to use transactions, so I have read the manual ana I
thought I knew how to do it. I set the tables type to InnoDB (i can't
use BDB) and change the default mysqld.exe to mysql-max (or
mysql-max-nt). I even used : SET AUTOCOMMIT=0.
I'm doing more less this:
1. START TRANACTION (i've tried also BEGIN /WORK/ )
2. UPDATE some table for example :
UPDATE account SET balance=balance-100 WHERE id=2
---- 1 row affected by the last command, no resulset returned
//Shouldn't it waite until COMMIT ??
---- Query returned no resultset
I looks like Mysql doesn't support transactions.
Does anyone have any suggestions about possible cause of tis problem?
Maybe some link? Any advise would be apreciated. I don't know what to
Please help me :/
Re: MYsql & transactions
An update never returns a resultset.
The query can still tell you how many rows were affected. It doesn't
mean the change is committed yet. You wouldn't want to find out
you'd made a typo, leaving off the WHERE clause, and affected 100,000
records *AFTER* you typed "COMMIT", would you? Or perhaps you
should check what you just did if it comes back "0 rows affected".
A rollback never returns a resultset.
How do you conclude that? Did the balance change from step 2 take
after the rollback? If so, it doesn't look like there is transaction
support. If not, it looks like there IS.
Gordon L. Burditt
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum