-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate 3.6 and MySQL blobs
PostPosted: Tue Dec 14, 2010 2:11 pm 
Newbie

Joined: Tue Dec 14, 2010 1:47 pm
Posts: 1
Hi,
We have an application, that was working well using Hibernate 3.5.6. After we updated to Hibernate 3.6.0 we have problems with the MySQL version.
After the update we have problems when we write blobs. We get an exception that some characters are invalid:

Code:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '^O\0^A\0^A\0\0\0\0\0\0\0\0\0\0\0\0\0^Y^A?\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' at line 1


We use an Jdbc URL defining the "sql_mode=NO_BACKSLASH_ESCAPES". When I remove this configuration the blobs can be written and read, but the tests using queries with backslashes fail, which works find when "sql_mode=NO_BACKSLASH_ESCAPES" is set.

It seems that streams are not used any more by default for MySQL. I tried to define hibernate.jdbc.use_streams_for_binary=true in a hibernate.properties file, but that did not work either. This will lead to conversion exceptions when reading the blob:
Code:
org.springframework.orm.jpa.JpaSystemException: org.hibernate.HibernateException: Unknown unwrap conversion requested: java.sql.Blob to org.hibernate.type.descriptor.BinaryStream;
nested exception is javax.persistence.PersistenceException: org.hibernate.HibernateException: Unknown unwrap conversion requested: java.sql.Blob to org.hibernate.type.descriptor.BinaryStream
        javax.persistence.PersistenceException: org.hibernate.HibernateException: Unknown unwrap conversion requested: java.sql.Blob to org.hibernate.type.descriptor.BinaryStream
        org.hibernate.HibernateException: Unknown unwrap conversion requested: java.sql.Blob to org.hibernate.type.descriptor.BinaryStream


Maybe there is some kind of configuration option I am missing. Any hint is welcome.

Thanks in advance,
Tom


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

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.