From: Heiko W.Rupp <heiko.rupp@redhat.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?
Date: Thu, 1 Mar 2007 21:48:00 +0100
Message-ID: <3AC75FD4-F9DC-4B9E-AA60-38F67EFD39B0@redhat.com> (raw)
In-Reply-To: <40939ed60703010604j149caad2n92dccac2ae6f6824@mail.gmail.com>
References: <40939ed60703010604j149caad2n92dccac2ae6f6824@mail.gmail.com>
Hi,
Am 01.03.2007 um 15:04 schrieb Ahmed Abd-el-Shafy Abd-Allah:
> Internal Exception: org.postgresql.util.PSQLException : ERROR: column
> "pools" is of type smallint but expression is of type character
> varyingError Code: 0
>
> Call:INSERT INTO MYTABLE (POOLS) VALUES (?)
> bind => [ null]
> Query:InsertObjectQuery(aaacs.rex.ejb.entities.MyTable@10b287f)
We have the very same problem with JBoss EJB3 and Postgres.
Our "solution" is to get the underlying Hibernate session via
EntityManager.getDelegate() and call the setNull() (?) Method
from Hibernate for this. So the problem is twofold:
- EJB3 being too stupid to have a setNull() method
- Postgres JDBC driver not automatically the right thing anyway
Heiko
--
Heiko W.Rupp
heiko.rupp@redhat.com, http://www.dpunkt.de/buch/3-89864-429-4.html
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: heiko.rupp@redhat.com
Subject: Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?
In-Reply-To: <3AC75FD4-F9DC-4B9E-AA60-38F67EFD39B0@redhat.com>
References: <40939ed60703010604j149caad2n92dccac2ae6f6824@mail.gmail.com> <3AC75FD4-F9DC-4B9E-AA60-38F67EFD39B0@redhat.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