]
Duncan Kinnear commented on HBX-1144:
-------------------------------------
Note that the PostgreSQL version does not seem to affect this. It is working fine on
machines with versions 8.3.1 and 8.3.7, but the column is not being updated on machines
with DB version 8.3.0 and 8.3.5.
We're pretty sure that all the machines have the version of Hibernate that was in the
tar file specified above.
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: