473,412 Members | 2,088 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,412 software developers and data experts.

MySQL's autocommit

Below is what I got by using MySQL's --log startup option. The original
Java(with JDBC driver) program that creates the queries at runtime was coded
by other people, and unfortunately, they are not available to answer any
question.
My question is: Do we need so many "SET autocommit=1" at all? Bu default,
MySQL always starts a new connection with autocommit
enabled.(?dev.mysql.com/doc/mysql/en/InnoDB_and_.., do we need to do "SET
autocommit=1" ourselves so frequently?
I know it's hard to analyze queries without looking at the program, but
that's what I can do so far. The following queries are simply to insert new
data into two relevant tables. The SELECT statements are to make sure that
no duplicate data(the Java program actually provide the logic).

SET autocommit=1
SELECT * FROM `Document` WHERE Id='000-0448.html'
SET autocommit=1
SELECT * FROM DS WHERE Name='ters-1000'
SET autocommit=1
INSERT INTO `Document` (Id,Title,ModifiedDate,CS,DSID) VALUES
('000-0448.html','000-0448.html','2002-10-30 18:40:22.0',-1,3)
INSERT INTO `DocumentImage` (DocumentID,DocumentText) VALUES (148,'This is a
test')
SET autocommit=1
SELECT * FROM `Document` WHERE Id='000-0454.html'
SET autocommit=1
SELECT * FROM DS WHERE Name='ters-1000'
SET autocommit=1
INSERT INTO `Document` (Id,Title,ModifiedDate,CS,DSID) VALUES
('000-0454.html','000-0454.html','2002-10-30 18:40:22.0',-1,3)
INSERT INTO `DocumentImage` (DocumentID,DocumentText) VALUES (149,'This is
a test')
SET autocommit=1
Jul 20 '05 #1
0 5283

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

Similar topics

5
by: j-marvin | last post by:
The example uses the mysql client delimiter command to change the statement delimiter from ; to // while the procedure is being defined. This allows the ; delimiter used in the procedure body to be...
0
by: Chris | last post by:
Is there some way to turn off mysql autocommit when connecting? I see no reference to "autocommit" in the db api doc. I'm trying to use transactions with mysql (using innodb tables), and it looks...
11
by: grumfish | last post by:
I'm trying to add a row to a MySQL table using insert. Here is the code: connection = MySQLdb.connect(host="localhost", user="root", passwd="pw", db="japanese") cursor = connection.cursor()...
5
by: sinan , | last post by:
hi everybody, i have a small mysql connection code >>> import MySQLdb >>> db=MySQLdb.Connection(host="localhost",user="root",db="nux") Traceback (most recent call last): File "<stdin>", line 1,...
11
by: Durai | last post by:
Hi All, I tested "concurrent testing" in MySQL. It works fine. But I couldn't do in PostgreSQL 7.3.4 on HPUX IPF. I got deadlock problem. I used the PHP script to update table( one script...
12
by: timothy.williams | last post by:
Hi. I have a Python program that parses a file and inserts records into a database with MySQLdb. I recently upgraded to MySQL 5.0.8, and now my parser runs *really* slow. Writing out to CSV...
6
by: onnodb | last post by:
Hi all, While working on an Access UI to a MySQL database (which should be a reasonable, low-cost, flexible interface to the DB, better than web-based, much less costly than a full-fledged .NET...
14
by: Ben | last post by:
I don't know whether anyone can help, but I have an odd problem. I have a PSP (Spyce) script that makes many calls to populate a database. They all work without any problem except for one...
1
by: =?ISO-8859-1?Q?Hans_M=FCller?= | last post by:
Hi, I'd like to modify some tables in a database in one transaction. This approach doesn't work: import MySQLdb con = MySQLdb.connect("servernam", user = "username", passwd = "verysecret,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.