Unix Technical Forum

Hibernate + setObject() + boolean problem with a patch

This is a discussion on Hibernate + setObject() + boolean problem with a patch within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:05 PM
Kalle Kivimaa
 
Posts: n/a
Default Hibernate + setObject() + boolean problem with a patch


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 11:05 PM
Kris Jurka
 
Posts: n/a
Default Re: Hibernate + setObject() + boolean problem with a patch



On Fri, 18 Feb 2005, Kalle Kivimaa wrote:

> We are using Hibernate on top of PostgreSQL and with a recent switch
> to PostgreSQL 8.0 we ran into a problem that trying to insert rows
> with null boolean fields to the DB failed miserably. I traced the
> problem to the fact that Hibernate wants to do this throuhg
> setObject() and this does not handle null booleans. The attached patch
> handles the booleans the same way as bits are handled which I think is
> the correct way (at least it solved our problem).
>


This fix is not correct because the Jdbc2 classes must be compilable by a
1.2 and 1.3 JDKs which do not have Types.BOOLEAN available. A fix of this
kind would need to go into one of the Jdbc3 classes which are only
compiled by >= 1.4 JDKs. I also don't believe your fix is necessary.
org.postgresql.test.jdbc3.TypesTest has the following test in it
pstmt.setObject(2, null, Types.BOOLEAN) and it works fine. Could you be
more clear on what your problem was (with a stacktrace)? If you are using
a jdbc2 version driver then it won't work and you need to use a jdbc3
driver.

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:53 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com