-->
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.  [ 1 post ] 
Author Message
 Post subject: Oracle 10g/9i dialect sequence not created
PostPosted: Thu Nov 06, 2008 1:16 pm 
Newbie

Joined: Thu Nov 06, 2008 1:01 pm
Posts: 1
Location: Paris
Hello,
I am quite new in hibernate and I face the following issue.
I am using an oracle 10g database. In my hibernate class, I specify to create the id in auto mode and for oracle, hibernate create a sequence.
The software I use needs several instance of databases with the same tables and sequences.
I create a first instance successfully, but for the other instance (in other schema), the sequence hibernate_sequence is not created.
Actually, the sequence is created if I use Oracle9Dialect but not if I use Oracle9iDialect or Oracle10gDialect.
After looking into the implementation of the dialect I understand why. The method getQuerySequencesString is implemented differently for Oracle9Dialect and Oracle9iDialect. In Oracle9Dialect, it select the sequence into user_sequences so that it return only the sequence of the connected user schema.
But for Oracle9iDialect it reads the sequence from all_sequences so that even if the sequence is not created into the current schema, it found the sequence because it has been created in another schema.
Actually, I have overwriten the method getQuerySequencesString in Oracle10gDialect to use user_sequences instead of all_sequences so that it is working.
this solution works because the connected user and the schema specified in default_schema property are the same.
May be the method getQuerySequencesString should have one parameter, the schema, to specify that the request should be done only for this schema.

My question is: should I report a bug in the jira tracker or not.

Thank you.

_________________
Sylvain Lemasson


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.