pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: temp table problem due to thread concurrency ( ERROR:  could not open file "base/ ) ?
Date: Wed, 7 May 2014 11:13:56 -0700 (PDT)
Message-ID: <1399486436626-5803003.post@n5.nabble.com> (raw)
In-Reply-To: <trinity-7399eb94-5d8b-4135-9b99-8fcb8e85a6ee-1399477521298@3capp-gmx-bs08>
References: <trinity-7399eb94-5d8b-4135-9b99-8fcb8e85a6ee-1399477521298@3capp-gmx-bs08>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Why cannot you just:

Open Connection
Begin;
Create TEMP Tables
Do stuff with TEMP Tables
Commit;
Close Connection (auto-drops TEMP tables)

Also, figuring out if you code is broken is much easier if we can actually
see the code; describing it only in plain English doesn't usually result in
people providing useful answers.  Both code and description are usually
needed.

Temporary tables are session-local and so as long as you do not actively
share a connection dropping temporary tables and these kinds of concurrency
errors should be impossible.  Since you are seeing them, and you feel the
need to drop temporary tables, either you are doing things wrong or at
minimum doing unnecessary work.

Server processes (PostgreSQL is process, not thread, based) are connection
(and thus session) oriented.

Client threads/processes are whatever you tell your code to do; connections
themselves are not inherently thread-safe so if you are multi-threading and
sharing connections you are doing something highly discouraged and, given
the errors, are doing so incorrectly.

David J.







--
View this message in context: http://postgresql.1045698.n5.nabble.com/temp-table-problem-due-to-thread-concurrency-ERROR-could-not...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


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



view thread (2+ messages)

Message-ID: <1399486436626-5803003.post@n5.nabble.com>
Permalink:  ../1399486436626-5803003.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1399486436626-5803003.post@n5.nabble.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: temp table problem due to thread concurrency ( ERROR:  could not open file "base/ ) ?
  In-Reply-To: <1399486436626-5803003.post@n5.nabble.com>
  References: <trinity-7399eb94-5d8b-4135-9b99-8fcb8e85a6ee-1399477521298@3capp-gmx-bs08> <1399486436626-5803003.post@n5.nabble.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