-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Postgres blob support
PostPosted: Sat Feb 26, 2005 3:32 pm 
Beginner
Beginner

Joined: Sat Feb 26, 2005 12:09 pm
Posts: 27
Location: Helsinki, Finland
The manual warns that the blob implementions in some JDBC drivers do not work properly. Are blobs supposed to work with Postgres?

I am using Postgres 8 and Hibernate 2.1.7c.

When I try to fetch an object that has a blob field (contains XML) from the database, the Postgres JDBC driver apparently tries to coerce the blob value into an int!

Caused by: org.postgresql.util.PSQLException: Bad value for type int : <?xml version="1.0" encoding="UTF-8"?>...
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2508)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:1984)
at org.postgresql.jdbc3.Jdbc3ResultSet.getBlob(Jdbc3ResultSet.java:54)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBlob(AbstractJdbc2ResultSet.java:312)
at net.sf.hibernate.type.BlobType.get(BlobType.java:32)
...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 26, 2005 8:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Blobs will work on Postgres in 3.0 final.

If you really need it, I can backport this to 2.1.x (you could easily backport it yourself.)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 27, 2005 4:21 am 
Beginner
Beginner

Joined: Sat Feb 26, 2005 12:09 pm
Posts: 27
Location: Helsinki, Finland
Thank you for the reply.

The reason why I am using 2.x and not 3.0 is that a month ago I could not find a 3.0-compatible replacement for hibernate-tools.jar. I need hbm2java.CodeGenerator (with finder generation) and hbm2ddl.SchemaExport.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.