473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

MYsql & transactions

Hello

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 ??
3. ROLLBACK
---- 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
do.

Please help me :/
Tom

Aug 22 '05 #1
5 2028
>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 An update never returns a resultset. //Shouldn't it waite until COMMIT ??
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".
3. ROLLBACK
---- Query returned no resultset
A rollback never returns a resultset.
I looks like Mysql doesn't support transactions.
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.
Does anyone have any suggestions about possible cause of tis problem?


What problem?

Gordon L. Burditt
Aug 22 '05 #2
Ok
You right and I didn't explain enough my situation.
I didn't write, but after the rollback the balance remained changed,
while according to manual it should changed back.
In other words I can't cancel changes made to a table and I wish I knew
how to do it.

Aug 22 '05 #3
>You right and I didn't explain enough my situation.
I didn't write, but after the rollback the balance remained changed,
while according to manual it should changed back.
In other words I can't cancel changes made to a table and I wish I knew
how to do it.


Are you sure your tables are InnoDB, not MyISAM? SHOW CREATE TABLE
or SHOW TABLE STATUS to find out.

Gordon L. Burditt
Aug 22 '05 #4
Yes definitely. Engine: InnoDB :(.

Aug 22 '05 #5
Ok I think I works now a bit better. I will test my server more and
I'll write how it works.

Thank's for you help and time.

Aug 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Westcoast Sheri | last post by:
Two mySQL Questions: 1.) how to numerically increase or decrease the value of a mySQL column 2.) what is the best column structure (e.g. "varchar" or "char" etc.) for speediest...
0
by: Heikki Tuuri | last post by:
Hi! Many people have complained over years that Borland's dbExpress driver does not work with MySQL and transactions, because it disconnects from mysqld after each SQL statement. The postings...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
by: JP | last post by:
My company is considering acquisition of a packaged application that's based on My SQL. This would be our first use of MySQL and the CEO is worried about using a "no-name" database (he's a...
10
by: smorrey | last post by:
Hello all, this might better be suited for the MySQL newsgroup, but I figured I'ld post here and see if anyone can help me. I'm trying to create a simple transaction handling system where users...
10
by: tuco357 | last post by:
This problem has been vexing me for some time and I thought I should consult the group.... Often times when writing a php script to handle some mysql DB transactions, I must write code that...
4
by: linusthefish | last post by:
Is it possible to use JavaScript & MySQL? What I'm looking to do is query a database and then output the results in a popup window. I've got the popup window part down, I just can't figure out...
13
by: miker2 | last post by:
HI, I'm having trouble writing to a MySql db using python and the MySQLdb module. Here is the code: import MySQLdb base = MySQLdb.connect(host="localhost", user="blah", passwd="blah",...
12
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.