Re: Empty SELECT result at simultaneous calls

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Stefan Wild <wilds81(at)yahoo(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Empty SELECT result at simultaneous calls
Date: 2010-09-09 00:30:15
Message-ID: 4C882A97.5060401@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/09/2010 11:40 PM, Stefan Wild wrote:
> Hello,
>
> as already stated: "When I'm working with delays in the servlets, everything works fine." the same selects on the same id work fine if delayd. So the data should not be the problem.

Is this freshly inserted data you're having issues with?

If so, I suspect you're running into issues where the data has been
written in another transaction but that transaction has not yet
committed. The data is **NOT** visible to other transactions until the
writing transaction commits.

That's by design. PostgreSQL does not have a "READ UNCOMMITTED" mode
that would permit data that's been written but not yet committed to be
seen by other transactions.

If that's what's biting you, you need to adjust your code so it only
expects to find data in the database that's actually been committed
(maybe by adding appropriate locking/synchronization/queuing), or you
need to use the same connection for reading and writing the uncommitted
data.

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2010-09-09 00:38:46 Re: variable name in plpgsql
Previous Message zhong ming wu 2010-09-09 00:23:20 variable name in plpgsql