By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

Is autocommit=true bad?

P: n/a
Greetings,
I've been tasked with maintaining a postgresql-7.3.4 database that has a
J2EE app on the front end.

In the pgsql log I see thousands upon thousands of entries like these:
WARNING: COMMIT: no transaction in progress

Through a little googling, I've determined it means that the folks who
wrote the J2EE app have set autocommit=true. I'm not, by any means, a
java programmer, so I'm not sure if setting autocommit=true serves any
useful purpose, other than not having to add BEGIN and END statements to
your code.

At any rate, are there any negative consequences to setting setting
autocommit=true, such as performance hits (and the obvios filling up
diskspace because of the logging)?

thanks!

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Lonni J Friedman ne******@linux-sxs.org
Linux Step-by-step & TyGeMo http://netllama.ipfox.com

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Net Llama! wrote:
At any rate, are there any negative consequences to setting setting
autocommit=true, such as performance hits (and the obvios filling up
diskspace because of the logging)?


The greatest negative consequence will be that the code obviously isn't
doing what the programmers think it's doing. The log entry is occuring
because someone is issuing a COMMIT somewhere - obviously expecting that
they're in a transaction at that point.

Check the code, and consider turning autocommit off if it looks like you
need a transaction over more than one statement.
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #2

P: n/a


On Tue, 27 Jan 2004, Net Llama! wrote:
Greetings,
I've been tasked with maintaining a postgresql-7.3.4 database that has a
J2EE app on the front end.

In the pgsql log I see thousands upon thousands of entries like these:
WARNING: COMMIT: no transaction in progress


I believe this is a symptom of an old version of the jdbc driver. Perhaps
upgrading that would make this go away.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #3

P: n/a
On Wed, 28 Jan 2004, Kris Jurka wrote:
On Tue, 27 Jan 2004, Net Llama! wrote:
Greetings,
I've been tasked with maintaining a postgresql-7.3.4 database that has a
J2EE app on the front end.

In the pgsql log I see thousands upon thousands of entries like these:
WARNING: COMMIT: no transaction in progress


I believe this is a symptom of an old version of the jdbc driver. Perhaps
upgrading that would make this go away.


OK thanks. I'm pretty ignorant of jdbc drivers. How could I determine
what version is the most recent, and which version is in use? thanks.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Lonni J Friedman ne******@linux-sxs.org
Linux Step-by-step & TyGeMo http://netllama.ipfox.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #4

P: n/a


On Wed, 28 Jan 2004, Net Llama! wrote:
On Wed, 28 Jan 2004, Kris Jurka wrote:
On Tue, 27 Jan 2004, Net Llama! wrote:
Greetings,
I've been tasked with maintaining a postgresql-7.3.4 database that has a
J2EE app on the front end.

In the pgsql log I see thousands upon thousands of entries like these:
WARNING: COMMIT: no transaction in progress


I believe this is a symptom of an old version of the jdbc driver. Perhaps
upgrading that would make this go away.


OK thanks. I'm pretty ignorant of jdbc drivers. How could I determine
what version is the most recent, and which version is in use? thanks.


The most recent version is 7.4.1 and can be downloaded from here:
http://jdbc.postgresql.org/download.html This will work on all older
versions and should be used regardless of your database version. To
determine what version you currently have you can use something like
this...

Connection conn = /* Get connection somehow */
DatabaseMetaData dbmd = conn.getMetaData();
System.out.println(dbmd.getDriverVersion());

Kris Jurka
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.