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: Owen Gibbins <oweng_at_autoplan.ws>
Date: Wed, 13 Nov 2002 15:40:38 -0800
Message-ID: <esBA9.190735$C8.485120@nnrp1.uunet.ca>


Point taken. Of course, the fact that it behaves like this is still irritating! Oh well.

> 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:40:38 CST

Original text of this message

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