467,122 Members | 1,302 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,122 developers. It's quick & easy.

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
  • viewed: 5023
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by j-marvin | last post: by
reply views Thread by Chris | last post: by
11 posts views Thread by grumfish | last post: by
5 posts views Thread by sinan , | last post: by
12 posts views Thread by timothy.williams@nvl.army.mil | last post: by
1 post views Thread by =?ISO-8859-1?Q?Hans_M=FCller?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.