pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Rodrigo Sakai <rodrigo.sakai@zanthus.com.br>
Cc: andy.shellam@mailnetwork.co.uk
Cc: pgsql-admin@postgresql.org
Subject: Re: IDLE IN TRANSACTION
Date: Wed, 19 Apr 2006 14:02:20 -0500
Message-ID: <1145473339.23538.125.camel@state.g2switchworks.com> (raw)
In-Reply-To: <004a01c663e2$4860a5d0$4700a8c0@TREEZANTHUS>
References: <20060419120510.B01C611F60B4@postgresql.org>
	<004a01c663e2$4860a5d0$4700a8c0@TREEZANTHUS>

On Wed, 2006-04-19 at 13:51, Rodrigo Sakai wrote:
> >No problem really, all it means is the application has issued a start
> of transaction command, it just isn’t doing anything at the moment.
> 
> 
> >Transactions allow any data added during the application’s running to
> be rolled back should, for example, the application crash – it’ll
> prevent half-written data remaining >stale in your database.
> 
> >My guess is when you Exit the application correctly, it’ll issue a
> COMMIT statement to store the transactional data to your database.
> 
>  
> 
>   Ok Andy, but what if I do an UPDATE operation on the database within
> this transaction, it will acquire exclusivelock on that table and will
> release only at the commit (or rollback) of this transaction, is that
> right?? So, if this transaction only finishes with the exit of the
> application the UPDATE operation will cause a lot of locks and
> deadlocks, won't they???

Normally when you see this behaviour, the application or possibly the
jdbc drivers are issuing a commit;begin; pair at the end of each
session.  This is to have the connection "ready to go" for the next
session.  It is a bad idea from the olden days that seems to find its
way back to the present every so often.

Usually there's a way somewhere to turn this behaviour off, whether it's
in your app or your driver.



view thread (13+ messages)  latest in thread

Message-ID: <1145473339.23538.125.camel@state.g2switchworks.com>
Permalink:  ../1145473339.23538.125.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1145473339.23538.125.camel@state.g2switchworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: smarlowe@g2switchworks.com, rodrigo.sakai@zanthus.com.br, andy.shellam@mailnetwork.co.uk
  Subject: Re: IDLE IN TRANSACTION
  In-Reply-To: <1145473339.23538.125.camel@state.g2switchworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox