[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6726) Oracle : map TextType to clob and ImageType to blob

Gail Badner (JIRA) noreply at atlassian.com
Mon Dec 5 02:15:21 EST 2011


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

Gail Badner commented on HHH-6726:
----------------------------------

After thinking about this more, I think we should keep the Oracle dialects as is. Here are my reasons:
- Hibernate defines the text/image types consistent with how Oracle maps LONGVARCHAR/LONGVARBINARY;
- the bug lies with Oracle;
- Oracle has effectively deprecated valid SQL data types (LONGVARCHAR and LONGVARBINARY);
- the migration from "text" to "materialized_clob" has already been documented since 3.5; "image" is a new type as of 3.6;
- anyone actually using text/image with LONG/LONGRAW columns may run into new migration issues in Hibernate 4.0.0; more testing would need to be done to determine the true impact;
- users can easily create a new dialect making the changes I mentioned earlier;
- this avoids having to make a confusing recommendation (i.e., using Oracle11gDialect for accessing an Oracle 10g DB).

You can create a custom dialect to make these changes by extending Oracle10gDialect and adding the following to the constructor:

                registerColumnType( Types.VARBINARY, 2000, "raw($l)" );
                registerColumnType( Types.VARBINARY, "blob" );

                registerColumnType( Types.LONGVARCHAR, "clob" );
                registerColumnType( Types.LONGVARBINARY, "blob" );

                registerColumnType( Types.VARCHAR, 4000, "varchar2($l char)" );
                registerColumnType( Types.VARCHAR, "clob" );


> Oracle : map TextType to clob and ImageType to blob
> ---------------------------------------------------
>
>                 Key: HHH-6726
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6726
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.CR4
>            Reporter: Strong Liu
>            Assignee: Gail Badner
>
> now, TextType (LONGVARCHAR) is mapped to 'long' and ImageType (LONGVARBINARY) is mapped to 'long raw'
> but 'long' and 'long raw' are already deprecated in oracle, we should consider change this to :
> Types.LONGVARCHAR -- "clob"
> Types.LONGVARBINARY -- "blob"
> and this causes lots of tests fail on oracle due to 'org.hibernate.exception.GenericJDBCException: Stream has already been closed'
> Gail,
> I'm assigning this to you since you created those two types and much familiar that than me :), but feel free reassign it, thanks

--
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