[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-1144) Weird Column Length problem - new length value in annotation being ignored

Duncan Kinnear (JIRA) noreply at atlassian.com
Tue Apr 20 18:29:23 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36528#action_36528 ] 

Duncan Kinnear commented on HBX-1144:
-------------------------------------

False alarm! We found the source of the problem and it was our fault. Someone had made a copy of the offending Entity class with a new name of FeedTypeCopy. Unfortunately, though, that entity still referred to the table FEED_TYPE. So on the machines that had the problem, Hibernate was obviously encountering the Copy version after the original and the table field was being reset back to 20.

I don't know how to change the status of this issue to Resolved, so hopefully someone can do that for me. 

> Weird Column Length problem - new length value in annotation being ignored
> --------------------------------------------------------------------------
>
>                 Key: HBX-1144
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1144
>             Project: Hibernate Tools
>          Issue Type: Bug
>    Affects Versions: 3.2.0.GA
>         Environment: Tar file was hibernate-3.2.6.ga.tar. Glassfish version 2.0 ur2. PostgreSQL version 8.x (various)
>            Reporter: Duncan Kinnear
>
> We are using Hibernate as our persistence layer with NetBeans 6.7.1, EJB3, Glassfish and PostgreSQL.
> We have almost 200 tables defined as EJB entities. We use annotations on the entities to define the tables/columns. As we are still in an early testing phase, we regularly drop all the tables in the database and use the Hibernate auto schema update to recreate them.
> Recently we changed the length of a standard field that appears in many of our tables. The column is called ID_ORDER and is defined in the entities using the following code:
>     @Column(name = "ID_ORDER", length = STANDARD_ID_ORDER_LENGTH, nullable = false)
>     private String idOrder;
> where STANDARD_ID_ORDER_LENGTH is defined as a public static final int in the superclass of these tables.
> This length used to be 20, but we increased this to 50, recompiled all the affected classes, dropped all the tables and redeployed.
> Now, on 2 developer machines this change worked correctly, with the new tables having their ID_ORDER columns all length 50.
> However, on the other 2 developer machines, one table (called FEED_TYPE) gets recreated with the ID_ORDER column with length 20. This also occurs when we deploy the resulting EAR file to another server running Glassfish.
> We have tried all sorts of things on these machines to try and 'fix' this. We have removed the column completely, recreated the table and it is still there! We have explicitly set the length in the annotation of the column of this one table and the length is always ignored. We have renamed the existing column and deployed, but the new column is always length 20. We have renamed the table and then recreated it - still wrong. We have even dropped the entire database and recreated it, but the length of 20 remains!
> We are pulling our hair out on this one, it just doesn't make any sense. Where is hibernate 'caching' the length definition of this one column in one table?

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