• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

executeUpdate() gets hanged while creating table in hibernate

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic