-->
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: Puzzle: Using remote oracle sequence?
PostPosted: Wed Sep 06, 2006 2:54 am 
Newbie

Joined: Tue Aug 09, 2005 9:09 am
Posts: 3
Hi

Is it possible to use remote Oracle sequence?
Correct syntax for Oracle is select someseq_seq.nextval@some.host.com from dual;

Hibernate tries: select someseq_seq@some.host.com.nextval from dual and fails.

a.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 06, 2006 5:58 am 
Newbie

Joined: Fri Aug 04, 2006 6:09 am
Posts: 18
I am using Oracle sequences succesfully with my domain objects.

The syntax you describe is not correct. There is no hostname needed when specifying the sequence.

Here's how i use sequences:

First create the sequence,

CREATE SEQUENCE COUNTRY_SEQ INCREMENT BY 1 START WITH 1 CACHE 5 ;

Then, in my xml file (this sequence is for countries):

Code:
<hibernate-mapping>
    <class name="com.amex.ifst.domain.Country" table="COUNTRY">
        <id name="countryId" type="int" unsaved-value="-1">
            <column name="COUNTRY_ID" precision="9" scale="0" />
            <generator class="sequence">
            <param name="sequence">country_seq</param>
            </generator>
        </id>
        <property name="countryCode" type="string">
            <column name="COUNTRY_CODE" length="2" not-null="true" />
        </property>


HTH,

R


Top
 Profile  
 
 Post subject: Re: Puzzle: Using remote oracle sequence?
PostPosted: Wed Sep 06, 2006 9:39 am 
Beginner
Beginner

Joined: Tue Aug 26, 2003 2:46 pm
Posts: 45
Location: Saskatoon SK Canada
katukas wrote:
Hi

Is it possible to use remote Oracle sequence?
Correct syntax for Oracle is select someseq_seq.nextval@some.host.com from dual;

Hibernate tries: select someseq_seq@some.host.com.nextval from dual and fails.



Have you tried creating an Oracle synonym for the remote sequence and then configure Hibernate to use the synonym?

_________________
Maury


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.