Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: setting a default ID with BC4J Entity
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
![]() |
![]() |