From: Oliver Jowett <oliver@opencloud.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: tightening up on use of oid 0
Date: Thu, 14 Oct 2004 12:13:37 +1300
Message-ID: <416DB6A1.4030808@opencloud.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0410131217520.22508@leary.csoft.net>
References: <41660A56.5000107@opencloud.com>
<4167BC1A.4070809@opencloud.com>
<Pine.BSO.4.56.0410120027040.9158@leary.csoft.net>
<416C3E22.9080605@opencloud.com>
<Pine.BSO.4.56.0410121550580.7695@leary.csoft.net>
<416CF557.2040000@opencloud.com>
<Pine.BSO.4.56.0410131217520.22508@leary.csoft.net>
Kris Jurka wrote:
>
> On Wed, 13 Oct 2004, Oliver Jowett wrote:
>
>
>>I'd like to catch those errors earlier than query execution if possible.
>>If nothing else, it'll encourage application developers to provide
>>correct type info to the driver in all cases..
>
>
> I don't see the real benefit of catching this one statement earlier. It's
> still a runtime failure.
My point was that it is useful to generate an error on *all* uses of
untyped nulls, so that the developer sees the error in all cases
regardless of the database state or statement context.
Consider, for example, framework code that calls user-specified or
user-provided functions. If it uses untyped nulls, and the driver uses
Oid.UNKNOWN, you will only see the problem when the framework tries to
pass a NULL to an overloaded function. If the driver rejects the call
with an error in all cases where a NULL is used, then the framework
developer sees the error as soon as they exercise the NULL path,
regardless of whether their test environment has overloaded functions or
not.
====
The spec has this to say about the setObject case:
>> If setObject is called without a type parameter, the Java Object is
>> implicitly mapped using the default mapping for that object type.
There is no default mapping (in appendix B table B-4) for Java nulls.
Of course the spec then goes on to say:
>> If a Java null is passed to any of the setter methods that take a Java
>> object, the parameter will be set to JDBC NULL.
I don't know which takes precedence. The way that setNull() is organized
implies that JDBC requires NULLs to be typed, but there's nothing
explicit about it.
-O
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: oliver@opencloud.com, books@ejurka.com
Subject: Re: tightening up on use of oid 0
In-Reply-To: <416DB6A1.4030808@opencloud.com>
References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <Pine.BSO.4.56.0410120027040.9158@leary.csoft.net> <416C3E22.9080605@opencloud.com> <Pine.BSO.4.56.0410121550580.7695@leary.csoft.net> <416CF557.2040000@opencloud.com> <Pine.BSO.4.56.0410131217520.22508@leary.csoft.net> <416DB6A1.4030808@opencloud.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