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

Mike Douglass (JIRA) noreply at atlassian.com
Wed Feb 10 00:34:29 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35517#action_35517 ] 

Mike Douglass commented on HHH-2614:
------------------------------------

I created a new dialect which seems to have resolved this - I'm a little suspicious that it was so easy. Am I missing something? My dialect is 

public class DerbyDialect extends org.hibernate.dialect.DerbyDialect {

	/**
	 *
	 */
	public DerbyDialect() {
		super();
    registerColumnType( Types.BLOB, "blob" );
    registerColumnType( Types.CLOB, "clob" );
	}
}

> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list