Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?

From: "Heiko W(dot)Rupp" <heiko(dot)rupp(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Inserting "null" not working (Sun App Server, Postgres, EJB3)?
Date: 2007-03-01 20:48:00
Message-ID: 3AC75FD4-F9DC-4B9E-AA60-38F67EFD39B0@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(dot)rex(dot)ejb(dot)entities(dot)MyTable(at)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(dot)rupp(at)redhat(dot)com, http://www.dpunkt.de/buch/3-89864-429-4.html

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tim Pizey 2007-03-01 20:59:29 Re: how to continue using a connection after an error with autocommit=false
Previous Message Dave Cramer 2007-03-01 20:22:46 Re: HELP: really and truly stuck