[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2614) Blob Length Set to 255 By Default With Derby DB

Strong Liu (JIRA) noreply at atlassian.com
Thu Apr 19 07:54:51 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46356#comment-46356 ] 

Strong Liu commented on HHH-2614:
---------------------------------

@Venkatesh

there is a workaround provided in HHH-7264

> Blob Length Set to 255 By Default With Derby DB
> -----------------------------------------------
>
>                 Key: HHH-2614
>                 URL: https://hibernate.onjira.com/browse/HHH-2614
>             Project: Hibernate ORM
>          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
>             Fix For: 3.6.6, 4.0.0.Beta4
>
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list