• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executeUpdate() gets hanged while creating table in hibernate

 
Sawan Mishra
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I m using SQLQuery to create one table...i 'm creating the foreign constraint in the program.

If i 'm executing the final Query generated in Sql editor then its the query is getting executed and table is created..
But while running the program the program gets hanged at insertQuery.executeUpdate()...

The query is generated is:::
CREATE TABLE apme_dc_reference
(
apme_dc_reference_refno integer NOT NULL ,
apme_dc_reference_name text ,
apme_dc_vendor text ,
apme_dc_version text ,
apme_dc_support_end_date text ,
apme_dc_extended_end_date text ,
apme_dc_subcategory text ,
apme_dc_edition text ,
apme_dc_technolgy_classification text ,
apme_dc_tag_unit_refno integer NOT NULL ,
apme_dc_version_refno integer NOT NULL ,
apme_dc_seqno integer NOT NULL ,
apme_dc_user_id text ,
apme_dc_field_filled_mode text ,
apme_dc_build_flag boolean ,
apme_dc_insert_timestamp timestamp without time zone DEFAULT now(),
CONSTRAINT pk_apme_dc_reference PRIMARY KEY (apme_dc_reference_refno),
CONSTRAINT fk_1_apme_dc_reference FOREIGN KEY (apme_dc_tag_unit_refno) REFERENCES apmc_dc_reference_category (apmc_dc_reference_sno) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION)


I cant find any mistake in it...but still database hangs at executeUpdate()...i hav no idea why its getting locked in this way...



please help me out
thanks
with regards
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you close your SQL Editor and try again? Maybe it has a lock on the table? Also, check you don't have Hibernate entities with a lock on the tables.

If that doesn't work, post what database you are using. We can tell you how to determine which statement has a lock for that database.
 
Sawan Mishra
Ranch Hand
Posts: 47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone i tried closing the sql editor and also it didnt work.Then I changed the table name to apmc_dc_ref_category which was earlier
apmc_dc_reference_category then it worked fine.Actually i think the problem was coming because the foreign key constraint statement was having
reference(apmc_dc_reference_category) keyword
(
CONSTRAINT fk_1_apme_dc_reference FOREIGN KEY (apme_dc_tag_unit_refno)
REFERENCES apmc_dc_reference_category (apmc_dc_reference_sno) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION)
)..
After i changed the tablename its coiming correctly...


Can anyone say how i can have the same tablename and still be able to create the table


thanks
regrds


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic