Search Postgresql Archives

Re: Empty SELECT result at simultaneous calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/10/2010 03:33 AM, Stefan Wild wrote:

Thanks for the good Idea! Unfortunately it is old data (already inserted since some days) so this cannot be the reason...

Is there any chance you can provide a self-contained example that includes both a populated database and the complete, compilable servlet code required to run it? If you can post a SQL dump of a test database that demonstrates the problem, and some Java sources that can be compiled to to a deployable .war, it'll be a lot easier to see what's going on.

As for the old data: are you sure the inserting transactions have committed? Nothing stops them from being open for hours or days.

If it's not that, my next best bet would be a concurrency bug in your code. That's not a slur on your programming skill; I'd assume the same thing if it was my code, because I know that bugs in released, tested PostgreSQL code are uncommon and bugs in my in-progress code are very common. In your case you're using a shared "DbManager" (the source code for which you have not supplied) and you haven't shown how you get from there to query execution and result processing. You also haven't shown how your code concludes that the results are empty.

PostgreSQL's JDBC driver is supposed to provide a fair degree of concurrency management, making sure that only one thread may use a given connection at a time. That only protects the driver and its connection(s) though; it can't protect your code. If you do out-of-spec things involving sharing resultsets, for example, you will have problems.

--
Craig Ringer


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux