-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: I FOUND A BUG IN HIBERNATE 3.0 (ABSOLUTELY POSITIVE)
PostPosted: Wed Mar 02, 2005 6:32 am 
Beginner
Beginner

Joined: Wed Jul 21, 2004 8:12 pm
Posts: 35
I just solved the problem of clob-text loading by getting around the problem. But this is caused by a bug in Hibernate 3.0.

Here is my original table definitions

CREATE TABLE README.COMMENT (COMMENT_ID BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
CATEGORY_ID BIGINT NOT NULL ,
AUTHOR VARCHAR (50)NOT NULL ,
TITLE VARCHAR(80) NOT NULL,
VISIBLE CHARACTER (1) NOT NULL,
CREATED_TIMESTAMP TIMESTAMP NOT NULL,
MODIFIED_TIMESTAMP TIMESTAMP NOT NULL,
COMMENT CLOB NOT NULL,
PRIMARY KEY (COMMENT_ID),
CONSTRAINT CATEGORY FOREIGN KEY (CATEGORY_ID) REFERENCES README.CATEGORY (CATEGORY_ID)ON DELETE CASCADE ,
CONSTRAINT EXCLUDE_FLAG CHECK (VISIBLE in ('Y', 'N')) );

Note that the primary key field name is "COMMENT_ID" and I have a field of Clob whose name is "COMMENT". When I run my test case the
"COMMENT" field does not appear in the sql statement and its value is set to the primary. Hibernate can not distinguish between these two names because of their similarity.
Here is the sql statement I got :
select comment0_.COMMENT_ID as COMMENT1_0_, releases1_.RELEASE_ID as RELEASE1_1_, comment0_.AUTHOR as AUTHOR1_0_, comment0_.TITLE as TITLE1_0_,
comment0_.VISIBLE as VISIBLE1_0_, comment0_.CREATED_TIMESTAMP as CREATED6_1_0_, comment0_.MODIFIED_TIMESTAMP as MODIFIED7_1_0_,
comment0_.CATEGORY_ID as CATEGORY8_1_0_, releases1_.PLATFORM_ID as PLATFORM2_4_1_, releases1_.PRODUCT_ID as PRODUCT3_4_1_,
releases1_.COMMENT_ID as COMMENT4_4_1_, releases1_.COMMENT_ID as COMMENT4___, releases1_.RELEASE_ID as RELEASE1___
from README.COMMENT comment0_ left outer join README.RELEASE releases1_ on comment0_.COMMENT_ID=releases1_.COMMENT_ID where (comment0_.COMMENT_ID=?)

I changed the name "COMMENT" to "NOTE" in my table definition and mapping file and then everything worked and "NOTE" appeared in the sql statement . Here is the sql

select comment0_.COMMENT_ID as COMMENT1_0_, releases1_.RELEASE_ID as RELEASE1_1_, comment0_.AUTHOR as AUTHOR1_0_, comment0_.TITLE as TITLE1_0_, comment0_.NOTE as NOTE1_0_, comment0_.VISIBLE as VISIBLE1_0_, comment0_.CREATED_TIMESTAMP as CREATED6_1_0_, comment0_.MODIFIED_TIMESTAMP as MODIFIED7_1_0_, comment0_.CATEGORY_ID as CATEGORY8_1_0_, releases1_.PLATFORM_ID as PLATFORM2_4_1_, releases1_.PRODUCT_ID as PRODUCT3_4_1_, releases1_.COMMENT_ID as COMMENT4_4_1_, releases1_.COMMENT_ID as COMMENT4___, releases1_.RELEASE_ID as RELEASE1___ from README.COMMENT comment0_ left outer join README.RELEASE releases1_ on comment0_.COMMENT_ID=releases1_.COMMENT_ID where (comment0_.COMMENT_ID=?)

I changed back the name "NOTE" TO "COMMENT" , the same problem (just to be sure before I post this message)

regards,


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 7:59 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
"COMMENT" is an SQL keyword "CREATE COMMENT ON ..."


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 8:16 am 
Beginner
Beginner

Joined: Wed Jul 21, 2004 8:12 pm
Posts: 35
I understand "Comment" is sql keywork, however; the original table definitions works perfectly fine with Hibernate 2.1.8.

Up until the yesterday, when I upgraded to Hibernate 3.0.,the field "COMMENT" was okay with 2.1.8. I can post the query generated by Hibernate 2.1.8 in which "comment" field works perfectly fine. However, if this is only the case for hibernate 3.0 as a new logic in which "comment" as a keyword can not be used as field name, then that is a different story.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 8:20 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Probably it confuses new parser


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 10:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
That should be fine. Submit a JIRA case with a simple executable reproducing the problem. We'll have a look.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 10:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I must admit, I find this extremely difficult to believe....


...but, anyway, go on, submit a test.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.