-->
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.  [ 7 posts ] 
Author Message
 Post subject: Unable to get started with the hibernate example
PostPosted: Sun Feb 01, 2004 6:56 am 
Newbie

Joined: Sun Feb 01, 2004 6:25 am
Posts: 3
After reading a lot of documentation on hibernate and hsqldb, I cannot get the hibernate example started. I am using hibernate 2.1.1 and hsqldb 1.7.1.

The procedure I use to get started:
unzip hibernate-2.1.1.zip
unzip hsqldb_1_7_1.zip
cp hsqldb/lib/hsqldb.jar hibernate-2.1/lib/
cd hibernate-2.1
vi src/hibernate.properties (choose jdbc:hsqldb:test as connection URL, comment out the others)
export JAVA_HOME=/opt/j2sdk1.4.2_03
ant eg

This gives a lot of errors, the first are:
[java] 11:47:00,105 DEBUG SchemaExport:132 - alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F
[java] 11:47:00,107 DEBUG SchemaExport:137 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F
[java] 11:47:00,108 DEBUG SchemaExport:138 - Table not found: AUCTIONITEM in statement [alter table AuctionItem drop constraint FK522A9BD6C9FF4F7F]

According to the readme.txt the line 'ant eg' should do the trick.

Well, I'm probably missing something but still cannot find what I'm missing exactly. Does anybody have a hint?

Thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 9:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Check the logs of schemaExport why the AuctionItem table is not created.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 10:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
These first errors (at debug level) are expected, SchemaExport, try to remove existing tables and constraints that does not yet exist (first time call). This can be safely ignored

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 10:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Ah yeah, I am really a bit slow thinking today ...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 12:24 pm 
Newbie

Joined: Sun Feb 01, 2004 6:25 am
Posts: 3
Yes, I agree those schemaExport errors can be safely ignored, but there is more in the log. I really don't know if it's OK to dump the entire log in here, so I'm taking pieces out of it...

First I deleted the test.data, test.properties, test.script (hsqldb files) and then ran it again...

After a log of schemaExport debug messages this comes out:

[java] 17:20:36,991 DEBUG SchemaExport:149 - create table AuctionItem (
[java] id BIGINT NOT NULL IDENTITY,
[java] description VARCHAR(255),
[java] ends TIMESTAMP,
[java] condition INTEGER,
[java] seller BIGINT not null,
[java] successfulBid BIGINT
[java] )
[java] 17:20:37,001 ERROR SchemaExport:154 - Unsuccessful: create table AuctionItem (id BIGINT NOT NULL IDENTITY, description VARCHAR(255), ends TIMESTAMP, condition INTEGER, seller BIGINT not null, successfulBid BIGINT)
[java] 17:20:37,003 ERROR SchemaExport:155 - Wrong data type: ID in statement [create table AuctionItem (id BIGINT NOT NULL IDENTITY, description VARCHAR(255), ends TIMESTAMP, condition INTEGER, seller BIGINT not null, successfulBid BIGINT)]
[java] 17:20:37,003 DEBUG SchemaExport:149 - create table AuctionUser (id BIGINT NOT NULL IDENTITY, userName VARCHAR(255) not null, "password" VARCHAR(255), email VARCHAR(255), firstName VARCHAR(255), "initial" CHAR(1), lastName VARCHAR(255))
[java] 17:20:37,004 ERROR SchemaExport:154 - Unsuccessful: create table AuctionUser (id BIGINT NOT NULL IDENTITY, userName VARCHAR(255) not null, "password" VARCHAR(255), email VARCHAR(255), firstName VARCHAR(255), "initial" CHAR(1), lastName VARCHAR(255))
[java] 17:20:37,004 ERROR SchemaExport:155 - Wrong data type: ID in statement [create table AuctionUser (id BIGINT NOT NULL IDENTITY, userName VARCHAR(255) not null, "password" VARCHAR(255), email VARCHAR(255), firstName VARCHAR(255), "initial" CHAR(1), lastName VARCHAR(255))]

Does this mean that hsqldb does not support BIGINT as a datatype, or am I still doing something wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 12:26 pm 
Newbie

Joined: Sun Feb 01, 2004 6:25 am
Posts: 3
Oh yes, I forgot to mention, the run ends (hangs, actually) with a stack trace, but that sounds logical because hibernate is trying to insert data in a non-existent table


[java] java.sql.SQLException: Table not found: AUCTIONUSER in statement [insert into AuctionUser (userName, "password", email, firstName, "initial", lastName, id) values ('oldirty', NULL, 'oldirty@hibernate.org', 'ol'' dirty', NULL, 'bastard', null)]
[java] at org.hsqldb.Trace.getError(Unknown Source)
[java] at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
[java] at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
[java] at org.hsqldb.jdbcConnection.execute(Unknown Source)
[java] at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
[java] at org.hsqldb.jdbcStatement.executeUpdate(Unknown Source)
<CUT>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 12:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Please use the version of HSQLDB from Hibernate CVS, which does not have this bug.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.