Re: [Pgjdbc-commit] By jurka: Add some more synchronization - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: [Pgjdbc-commit] By jurka: Add some more synchronization
Date
Msg-id Pine.BSO.4.63.0605220303360.21575@leary2.csoft.net
Whole thread Raw
In response to Re: [Pgjdbc-commit] By jurka: Add some more synchronization to the  (Markus Schaber <schabi@logix-tt.com>)
Responses Re: [Pgjdbc-commit] By jurka: Add some more synchronization  (Markus Schaber <schabi@logix-tt.com>)
List pgsql-jdbc

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

pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: [Pgjdbc-commit] By jurka: Add some more synchronization to the
Next
From: Markus Schaber
Date:
Subject: Re: [Pgjdbc-commit] By jurka: Add some more synchronization