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-).
|