You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Alen Ribic <al...@mweb.co.za> on 2003/05/07 20:25:13 UTC

PK and OBJ table issues

I started experimenting with OJB today and now I'm stuck on dealing with
autoincrement primary keys.
I don't wanna set my bean class'es ID attribute, I want OJB to automatically
set it or retreive it from my db.
I use org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl and it
works but I don't know if I did something wrong because I was origionaly
missing the OBJ specific tables in my db. So, manually I executed the
objcore-schema.sql against my db and that solved the problem. The thing is
that I have not seen one place where it says that your must create OBJ's
tables yourself in your db.
And last thing, why da hell does my table unique id increment my +/- 20 when
I add new row? :)

--Alen




Re: PK and OBJ table issues

Posted by Alen Ribic <al...@mweb.co.za>.
Thx.
But regarding the +20 id increment, hehehe, copyed and passed that piece
from code snipet. :)) ( <attribute attribute-name="grabSize"
attribute-value="20"/> )

--Alen

----- Original Message -----
From: "Jason McKerr" <mc...@nacse.org>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Wednesday, May 07, 2003 8:29 PM
Subject: Re: PK and OBJ table issues


> 1) You do not have to use the OJB sequencing.  You can use the
> pass-through sequencer that uses your database sequence.
>
> 2) 20+ thing: Alen, it uses a "grab size" for your sequences.  This is
> just an efficiency, as you would often restart a production server.
> However, again, you can configure this.
>
> Take a look here
>
> http://db.apache.org/ojb/howto-use-db-sequences.html
>
> Jason
>
>
>
> On Wed, 2003-05-07 at 11:25, Alen Ribic wrote:
> > I started experimenting with OJB today and now I'm stuck on dealing with
> > autoincrement primary keys.
> > I don't wanna set my bean class'es ID attribute, I want OJB to
automatically
> > set it or retreive it from my db.
> > I use org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl and
it
> > works but I don't know if I did something wrong because I was origionaly
> > missing the OBJ specific tables in my db. So, manually I executed the
> > objcore-schema.sql against my db and that solved the problem. The thing
is
> > that I have not seen one place where it says that your must create OBJ's
> > tables yourself in your db.
> > And last thing, why da hell does my table unique id increment my +/- 20
when
> > I add new row? :)
> >
> > --Alen
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>



Re: PK and OBJ table issues

Posted by Jason McKerr <mc...@nacse.org>.
1) You do not have to use the OJB sequencing.  You can use the
pass-through sequencer that uses your database sequence.

2) 20+ thing: Alen, it uses a "grab size" for your sequences.  This is
just an efficiency, as you would often restart a production server. 
However, again, you can configure this.

Take a look here

http://db.apache.org/ojb/howto-use-db-sequences.html

Jason



On Wed, 2003-05-07 at 11:25, Alen Ribic wrote:
> I started experimenting with OJB today and now I'm stuck on dealing with
> autoincrement primary keys.
> I don't wanna set my bean class'es ID attribute, I want OJB to automatically
> set it or retreive it from my db.
> I use org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl and it
> works but I don't know if I did something wrong because I was origionaly
> missing the OBJ specific tables in my db. So, manually I executed the
> objcore-schema.sql against my db and that solved the problem. The thing is
> that I have not seen one place where it says that your must create OBJ's
> tables yourself in your db.
> And last thing, why da hell does my table unique id increment my +/- 20 when
> I add new row? :)
> 
> --Alen
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org