• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

hibernate_sequence does exists ERROR

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


My id definition in code looks like this

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@Column(name = COLUMN_ID, unique = true, updatable = false)
private Integer id;

I am using Postgres 8.X as DB, JBOSS 5 as app server. Most of my primary keys in tables are defined as serial type in DB and generated through Postgres sequence.


I tried different GenerationType but it doesn't work.

The sequence generation used to work before with JBOSS 4.X. we recently upgraded to JBOSS5 and sequence generation started giving following error.(Not sure if JBOSS5 has anything to do with this error)

select
currval('wilshire_transactions_id_seq')

2009-08-07 16:15:11,609 INFO [STDOUT] (http-127.0.0.1-8080-1) Hibernate:
select
nextval ('hibernate_sequence')

2009-08-07 16:15:11,609 WARN [org.hibernate.util.JDBCExceptionReporter] (http-127.0.0.1-8080-1) SQL Error: 0, SQLState: 42P01

2009-08-07 16:15:11,609 ERROR [org.hibernate.util.JDBCExceptionReporter] (http-127.0.0.1-8080-1) ERROR: relation "hibernate_sequence" does not exist

Note currval is the right sequence name but for nextval it uses default hibernate_sequence. Not sure what I am missing?

If any of you have any idea, please help. Its a blocker for us.

Thanks for all your help,
-Chandni
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic