Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: setting a default ID with BC4J Entity

Re: setting a default ID with BC4J Entity

From: Martin Doherty <martin.doherty_at_elcaro.moc>
Date: Wed, 13 Nov 2002 15:22:13 -0800
Message-ID: <ocBA9.7$FE.179@news.oracle.com>


The 100% pragmatic, minimum-cost response is, "who cares?" Your problem is solved and you can move onto the next productive activity. If numbers are jumping 2 by 2, you will hit the sequence max value in 100 years instead of 200 years.

Owen Gibbins wrote:

>Thanks for replies.
>
>I've made it work with the following code:
>
> protected void create(AttributeList nameValuePair)
> {
> super.create(nameValuePair);
>
> setID((Number)getDBTransaction()
> .createViewObjectFromQueryStmt("SELECT producer_seq.nextval FROM
>DUAL")
> .next()
> .getAttribute(0));
> }
>
>The only issue is that it seems to increment by 2. The sequence is set to
>increment by 1, and in SQLPlus it does so. However, in my application the
>keys are genereated 2 by 2. But if I set a breakpoint within the create
>method, it is only encountered once (and thus I would think the SELECT
>statement would only be executed once).
>
>Is there a newsgroup that would perhaps be more appropriate for this
>JDeveloper question?
>
>Any help is appreciated!
>
>Owen
>
>
>
>
Received on Wed Nov 13 2002 - 17:22:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US