pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: [Pgjdbc-commit] By jurka: Add some more synchronization
Date: Mon, 22 May 2006 03:09:10 -0500 (EST)
Message-ID: <Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net> (raw)
In-Reply-To: <44716F52.8080202@logix-tt.com>
References: <20060522040707.37E9811C0611@gborg.postgresql.org>
	<44716F52.8080202@logix-tt.com>



On Mon, 22 May 2006, Markus Schaber wrote:

>>      // pgname (String) -> java.sql.Types (Integer)
>> -    private Map _pgNameToSQLType;
>> +    private static final Map _pgNameToSQLType;
>
> Are you shure this should be static, and not per connection?
>
> AFAICS, it is possible to have two connections to different databases
> having different extension types installed, leading to conflicting maps.
>

This maps betweeen a pg type name like varchar and a java.sql.Types value 
like Types.VARCHAR.  There is a hardcoded list of pg types that the driver 
knows about and can assign a Types value.  For types the driver doesn't 
know anything about, all it can say is that it is Types.OTHER.  Note also 
that in initialization it does:

_pgNameToSQLType = Collections.unmodifiableMap(pgNameToSQLType);

So there's no way it can get bad information into it.

Kris Jurka



view thread (2+ messages)  latest in thread

Message-ID: <Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net>
Permalink:  ../Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net

 · 

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: books@ejurka.com, schabi@logix-tt.com
  Subject: Re: [Pgjdbc-commit] By jurka: Add some more synchronization
  In-Reply-To: <Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net>
  References: <20060522040707.37E9811C0611@gborg.postgresql.org> <44716F52.8080202@logix-tt.com> <Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net>

* 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