Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Table not found in statement
PostPosted: Sat Apr 14, 2012 3:53 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
Hello,

I'm trying to run an integration test that should create a schema in an HSQLDB database but I get the following exception:

Quote:
Caused by: java.sql.SQLException: Table not found in statement [select top ? mail0_.id as id20_, ma
il0_.admin_id as admin11_20_, mail0_.attachments as attachme2_20_, mail0_.body as body20_, mail0_.c
ategory_id as category12_20_, mail0_.creation_datetime as creation4_20_, mail0_.description as desc
ript5_20_, mail0_.locked as locked20_, mail0_.send_datetime as send7_20_, mail0_.subject as subject
20_, mail0_.text_format as text9_20_, mail0_.version as version20_ from mail mail0_]


Here are my connection properties:

Code:
database.driverClassName = org.hsqldb.jdbcDriver
database.password =
database.url = jdbc:hsqldb:file:db_integration
database.username = sa


The file db_integration.properties contains the following:

#HSQL Database Engine 1.8.0.10
#Sat Apr 14 09:48:08 CEST 2012
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
hsqldb.cache_size_scale=8
readonly=false
hsqldb.nio_data_file=true
hsqldb.cache_scale=14
version=1.8.0
hsqldb.default_table_type=memory
hsqldb.cache_file_scale=1
hsqldb.log_size=200
modified=yes
hsqldb.cache_version=1.7.0
hsqldb.original_version=1.8.0
hsqldb.compatible_version=1.8.0

And the db_integration.log file shows:

Quote:
CREATE USER SA PASSWORD "" ADMIN
/*C1*/SET SCHEMA PUBLIC
CONNECT USER SA
DISCONNECT
/*C2*/SET SCHEMA PUBLIC
CONNECT USER SA
drop table address if exists
drop table admin if exists
drop table admin_module if exists
drop table admin_option if exists
drop table client if exists
drop table contact if exists
drop table contact_referer if exists
drop table contact_status if exists
drop table container if exists
drop table content_import if exists
drop table content_import_history if exists
drop table document if exists
drop table document_category if exists
drop table elearning_answer if exists
drop table elearning_assignment if exists
drop table elearning_assignment_class if exists
drop table elearning_category if exists
drop table elearning_class if exists
drop table elearning_course if exists
drop table elearning_course_item if exists
drop table elearning_exercise if exists
drop table elearning_exercise_page if exists
drop table elearning_lesson if exists
drop table elearning_lesson_heading if exists
drop table elearning_lesson_model if exists
drop table elearning_lesson_paragraph if exists
drop table elearning_level if exists
drop table elearning_matter if exists
drop table elearning_question if exists
drop table elearning_question_result if exists
drop table elearning_result if exists
drop table elearning_scoring if exists
drop table elearning_scoring_range if exists
drop table elearning_session if exists
drop table elearning_session_course if exists
drop table elearning_solution if exists
drop table elearning_subject if exists
drop table elearning_subscription if exists
drop table elearning_teacher if exists
drop table elearning_teacher_class if exists
drop table flash if exists
drop table form if exists
drop table form_item if exists
drop table form_item_value if exists
drop table form_valid if exists
drop table guestbook_entry if exists
drop table lexicon_entry if exists
drop table link if exists
drop table link_category if exists
drop table mail if exists
drop table mail_address if exists
drop table mail_category if exists
drop table mail_history if exists
drop table mail_list if exists
drop table mail_list_address if exists
drop table mail_list_user if exists
drop table mail_outbox if exists
drop table navbar if exists
drop table navbar_item if exists
drop table navbar_language if exists
drop table navlink if exists
drop table navlink_item if exists
drop table navmenu if exists
drop table navmenu_item if exists
drop table navmenu_language if exists
drop table news_editor if exists
drop table news_feed if exists
drop table news_heading if exists
drop table news_paper if exists
drop table news_publication if exists
drop table news_story if exists
drop table news_story_image if exists
drop table news_story_paragraph if exists
drop table people if exists
drop table people_category if exists
drop table photo if exists
drop table photo_album if exists
drop table photo_album_format if exists
drop table photo_format if exists
drop table preference if exists
drop table profile if exists
drop table property if exists
drop table rss_feed if exists
drop table rss_feed_language if exists
drop table shop_category if exists
drop table shop_item if exists
drop table shop_item_image if exists
drop table shop_order if exists
drop table shop_order_item if exists
drop table sms if exists
drop table sms_category if exists
drop table sms_history if exists
drop table sms_list if exists
drop table sms_list_number if exists
drop table sms_list_user if exists
drop table sms_number if exists
drop table sms_outbox if exists
drop table social_user if exists
drop table statistics_page if exists
drop table statistics_referer if exists
drop table statistics_visit if exists
drop table template_container if exists
drop table template_element if exists
drop table template_element_language if exists
drop table template_element_tag if exists
drop table template_model if exists
drop table template_page if exists
drop table template_page_tag if exists
drop table template_property if exists
drop table template_property_set if exists
drop table unique_token if exists
drop table user if exists
drop table webpage if exists
drop table webpage_navmenu if exists
SET AUTOCOMMIT FALSE
SET AUTOCOMMIT TRUE
... There were many more of these, which I removed to shorten the post ...
SET AUTOCOMMIT FALSE


How come I have all these drop table if exists statements and not create table statements ?


Last edited by stephaneeybert on Thu Apr 19, 2012 5:16 am, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: Table not found in statement
PostPosted: Sat Apr 14, 2012 3:55 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
This time, with a create instead of a create-drop the log shows the following:

/*C165*/SET SCHEMA PUBLIC
CONNECT USER SA
DISCONNECT


Top
 Profile  
 
 Post subject: Re: Table not found in statement
PostPosted: Sun Apr 22, 2012 12:42 am 
Pro
Pro

Joined: Mon Apr 16, 2007 8:10 am
Posts: 246
I switched to using H2 instead of HSQLDB and I could run the tests fine.

Here is the setup:
Code:
database.driverClassName = org.h2.Driver
database.password =
database.url = jdbc:h2:db_integration
database.username = sa


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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.