[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2614?page=c...
]
Jeff Jensen commented on HHH-2614:
----------------------------------
Just encountered this problem too. With supporting multiple databases, having to
determine a legitimate single value for all databases is not desirable. Different
databases can have different max values. Our preference is to use the database applicable
value, i.e. the default. Of course, this breaks with Derby.
Mike's custom dialect seems the best approach to try workaround this problem (and
Strong Liu: we don't want to set a length!).
Blob Length Set to 255 By Default With Derby DB
-----------------------------------------------
Key: HHH-2614
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2614
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: Apache Derby 10.2.2, Java 1.6.0
Reporter: Sean Sylvis
Assignee: Strong Liu
When the (Hibernate) type "blob" is used in an object mapping file and a length
is not specified, Hibernate converts this type as "blob (255)" to the Apache
Derby database table definition. (This seems to be the same as the conversion behavior of
a Java String to "varchar (255).") The same behavior results when using a
CustomType that returns a Java SQL Types.BLOB. This is not the behavior I expected.
Hibernate converts the same type as simply "blob" (which has a maximum length
of 65535 bytes when no length is specified) when using MySQL version 5.0
(
http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html). Furthermore, the Derby
specification (
http://db.apache.org/derby/docs/10.2/ref/rrefblob.html) states that a blob
type without a length value will default to a length of 2M-1 bytes.
I could not find a length specification for the Java SQL Blob type
(
http://java.sun.com/javase/6/docs/api/), but the current default length does seem to
conform to other Hibernate type standards. That is, if a length is not specified, the
length defaults to the maximum length defined for that type by the database.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira