-->
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: id generation / permission
PostPosted: Tue Sep 07, 2004 10:21 am 
Newbie

Joined: Tue Sep 07, 2004 9:53 am
Posts: 3
Hibernate version:2.1

Name and version of the database you are using:Oracle 9

I am using the Hibernate Property:

Quote:
default_schema

I set it to a schema, different then the user's schema.
So a mapping of table 'users' becomes 'default_schema.users' in sql

I am also using the hilo method of generating the id. My problem is that the id genertor class does not use the default schema I added in the Hibernate properties.
Everytime Hibernate is trying to read the 'HIBERNATE_UNIQUE_KEY' it doesn't add the default_schema to it and as a result I get a 'table not found exception'

I know that there are several workarounds such as setting your own id generation class or creating oracle synonym but I believe the real solution would be that if someone is setting a default schema it should be added as a default when Hibernate is looking for 'HIBERNATE_UNIQUE_KEY' or 'HIBERNATE_SEQ'

Is this a bug? or is there a reason for this?

Any info would be great,
Thanks
Igal


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 07, 2004 11:01 am 
Senior
Senior

Joined: Fri May 14, 2004 9:37 am
Posts: 122
Location: Cologne, Germany
Hi there,

if you could post the mapping that is causing the problem would be great. BTW you should take a look at chapter 5.1.4 of the reference doc of hibernate, it should become straight forward afterwards. For Oracle it'll better to use sequence or seqhilo to generate the keys.
For me your problem sounds like the table being used to get the next id doesn't exist even if the default schema would be used.

_________________
regards

Olaf

vote if it helped


Top
 Profile  
 
 Post subject: id generation
PostPosted: Wed Sep 08, 2004 3:31 am 
Newbie

Joined: Tue Sep 07, 2004 9:53 am
Posts: 3
Thanks for your replay.

The mapping for the default schema (in spring application context):

<property name="hibernateProperties">
<props>
<prop>X</prop>
</props>
</property>


The actual id mapping are standard:

<id name="id" column="business_unit_id" type="int" unsaved-value="-1">
<generator class="hilo"/>
</id>

I am sure that the table exist. What I did is to create my own extention to the id generating class:

<generator class="com.actimize.infrastructure.id.AcmTableHiLoGenerator">
<param name="table">HIBERNATE_UNIQUE_KEY</param>
<param name="column">next_hi</param>
</generator>

Then I debugged it and in no place during the debug process was there a value of the default schema. There is a different property called 'SCHEMA' that is associated with the id generation class. When I added a value to that property everything worked find.

I think that the id generation property 'SCHEMA' should get its default value from Hibernate property default_schema.

Is this a bug or a desired feature?

Using sequence has the same affect as using a table.


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.