-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: default schema not propagated to id generators
PostPosted: Wed Jan 19, 2005 2:51 pm 
Newbie

Joined: Wed Jan 19, 2005 1:49 pm
Posts: 1
Hibernate version: 2.1.7c
Name and version of the database you are using: Oracle 9 although I suspect this is a problem for all

There are a few other messages somewhat related to this problem, but none directly so I figured I would post a note to state the exact issue and the work-around for anyone seeing a similar issue

problem

The default schema property is not being properly propagated to the sequence generators during configuration.

example

Development is done using the schema owner (myApp) but deployment uses a different user (myApp_update_user).

myApp_update_user has full select grants for on the sequence.
This is verified via "select myApp.hibernate_sequence.NEXTVAL from dual" within SQLPlus while connected as myApp_update_user.

Running the app with user myApp, everything works fine.
Running the app with user myApp_update_user, and everything except inserts works. Inserts cause "java.sql.SQLException: ORA-02289: sequence does not exist" (naturally, because they exercise the key generator).

I checked the properties being passed to the generator, and no schema is passed in (neither schema nor default_schema).

work-around

Explicitly set the schema in each mapping file used.


plea for fix

What's the chance of a fix for this being included in the next version? It would be nice to have default_schema be, well, honored as the default schema 8-).

As a side note, I've gotta extend huge kudos to the dev team. Hibernate works very well. This is only the first real issue I've come across, and I think it's pretty minor, all things considered 8-).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 8:43 pm 
Regular
Regular

Joined: Wed Jan 07, 2004 5:16 pm
Posts: 65
Location: CA, USA
We found we can pass the default schema as a property through to the JDBC driver. This works with the JDBC driver for DB2, not sure it it works for other DBs. Add this to your hibernate.cfg.xml:

<property name="hibernate.connection.currentSchema">DEFAULT_SCHEMA_VALUE</property>

Kevin Hooke


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 10:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Its complex and will no be fixed in H2 I thnik it has been fixed in H3 but I'm not sure about that

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.