473,837 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2054
>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
24170
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 increasing/decreasing Here is the idea: I sell fruit. I start with 100 apples, 100 bananas, and 100 grapes.
0
3332
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 below suggests that this problem might now be fixed by Borland. Best regards, Heikki Tuuri
0
3955
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 version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
2
3899
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 Microsoft bigot). His specific concern is that an app written on MySQL will not have the necessary throughput and he's asked me to research MySQL's capabilities. From everything I've read so far, I'm comfortable that throughput will not be a problem...
10
2145
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 pay eachother via points of a sort. I have a table where each transaction is stored, in a single row. It looks like this transid,from_user,from_amount,to_user,to_amount
10
1485
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 performs, say, an insert into a MySQL DB, then retrieves the last item's index, and makes a new insertion into another table on the DB that requires the previously obtained index. Both queries must be executed and completed - if query one succeeds...
4
1985
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 how to query the database. Is it possible? TIA, Benjy
13
1967
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", db="test_py") cursor = base.cursor() cursor.execute("INSERT INTO table (field) VALUES (int)")
12
4454
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 table. Then read the second line in text file and repeat. Thanks for your time Ian
0
9837
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10870
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10267
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9392
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5668
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5845
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3123
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.