Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate error..need help!

 
Jack Wiesenthaler
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to map a bean to a view. All my code does at this point is obtain a session from the SessionFactory and then close the session. However, during initialization I am getting some SQL errors...

INFO: table not found: SPQT_VW_TEST
Jun 20, 2005 5:57:04 PM org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
INFO: table not found: SPQT_VW_TEST
Jun 20, 2005 5:57:04 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
SEVERE: Unsuccessful: create table SPQT_VW_TEST (<<...table structure...>>

Jun 20, 2005 5:57:04 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
SEVERE: ORA-00955: name is already used by an existing object

My question is why is Hibernate trying to execute a "create table"? Since this is a view it will be only used for read only. The generator class I defined for my Primary key column is of type "increment" but I've also tried "assigned". Any ideas? Thanks very much for any help.
 
Dave Segal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kevin - I'm new to Hibernate also, but here's my guess...

Since the error message says table not found: SPQT_VW_TEST, my first step would be to log onto the account and database specified in your Hibernate config file and verify that the table exists and that the account has access to it.

If the table is owned by an account other than the one that you are connecting to in the config file, then you will need to either use a synonym or prepend a schema name to the table name.(ie "schemaname.spqt_vw_test") I prefer to use public synonyms at the database level.
 
Jack Wiesenthaler
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave, the problem turned out to be this property in the Hibernate config file:

<property name="hibernate.hbm2ddl.auto">update</property>

Supposedly in Hibernate3 "update" has the same effect as "create" and this tells Hibernate to re-create the specified table on startup. The create was failing because the account I am using does not have create privileges.

http://www.hibernate.org/74.html#A30

When I removed it the "create table" SQL is no longer being called during initialization
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic