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 Duffy Gillman <gi...@u.library.arizona.edu> on 2003/04/05 01:21:43 UTC
core OJB tables; auto-increment
Hi,
I am trying to use OJB as part of a web-service. The database may be
accessed by other software. I need to find answers to the following
questions:
1) How do I create the core OJB tables in my database? In the
documentation I am only finding the "prepare-testdb" ant target. This
builds a bunch of extra tables that I do not want. Surely I can drop the
extra tables... but I would like to know how to just build the core ones
into my project (OJB_HL_SEQ, OJB_LOCKENTRY, OJB_NRM, OJB_DLIST, etc...).
2) Is using the OJB sequence manager the only way to get OJB to work with
sequences? Several PK fields in my database are autoincrement. Will the
OJB create its OWN sequences for these (i.e. if another application relies
on the sequence maintained by the RDBMS itself, will it clash with the
sequence OJB is maintaining?)?
Thanks in advance,
Duffy
--
=====================================
Duffy Gillman
POLIS Systems Programmer
Learning Technology Center
PO Box 210073, CCIT Bldg., Rm. 337
1077 N. Highland Ave.
Tucson, AZ 85721-0073
520.626.0117 (voice)
520.626.8220 (fax)
=====================================
Re: core OJB tables; auto-increment
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Duffy,
----- Original Message -----
From: "Duffy Gillman" <gi...@u.library.arizona.edu>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Saturday, April 05, 2003 1:21 AM
Subject: core OJB tables; auto-increment
> Hi,
>
> I am trying to use OJB as part of a web-service. The database may
be
> accessed by other software. I need to find answers to the following
> questions:
>
> 1) How do I create the core OJB tables in my database? In the
> documentation I am only finding the "prepare-testdb" ant target. This
> builds a bunch of extra tables that I do not want. Surely I can drop
the
> extra tables... but I would like to know how to just build the core
ones
> into my project (OJB_HL_SEQ, OJB_LOCKENTRY, OJB_NRM, OJB_DLIST,
etc...).
it's one point of the todo list, to separate internal table creation.
>
> 2) Is using the OJB sequence manager the only way to get OJB to work
with
> sequences?
Think I don't understand what you mean. If you want to use the
'autoincrement'
feature you have to use one of the SequenceManager implementations. But
it's
also possible to set the PK fields before store.
> Several PK fields in my database are autoincrement. Will the
> OJB create its OWN sequences for these (i.e. if another application
relies
> on the sequence maintained by the RDBMS itself, will it clash with the
> sequence OJB is maintaining?)?
You could set a 'sequence-name' attribute in the field-descriptor, then
the
SequenceManager use this sequence-name. If not set OJB create its own.
See http://db.apache.org/ojb/sequencemanager.html
regards,
Armin
>
> Thanks in advance,
>
> Duffy
>
> --
> =====================================
> Duffy Gillman
> POLIS Systems Programmer
>
> Learning Technology Center
> PO Box 210073, CCIT Bldg., Rm. 337
> 1077 N. Highland Ave.
> Tucson, AZ 85721-0073
>
> 520.626.0117 (voice)
> 520.626.8220 (fax)
> =====================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
Re: core OJB tables; auto-increment
Posted by Duffy Gillman <du...@u.library.arizona.edu>.
Jason,
Thanks. I had uncovered the list of tables to keep. I am curious
though, is there an ant build target that will create these tables AND
NONE OTHER. This is the crux of my question. I am doing a lot of testing
and rebuilding. It would be nice to simply create these required tables
and none of the ones related to the test application.
The page on sequencemanagers is very helpful. Thank you.
-Duffy
On 4 Apr 2003, Jason McKerr wrote:
> For the tables that you'll need to keep, refer to
>
> http://db.apache.org/ojb/platforms.html
>
> And no, you don't need to use the default sequence manager. Please
> refer to the following for more on sequence manager stuff.
>
> http://db.apache.org/ojb/sequencemanager.html
>
>
> Jason
>
>
>
> On Fri, 2003-04-04 at 15:21, Duffy Gillman wrote:
> > Hi,
> >
> > I am trying to use OJB as part of a web-service. The database may be
> > accessed by other software. I need to find answers to the following
> > questions:
> >
> > 1) How do I create the core OJB tables in my database? In the
> > documentation I am only finding the "prepare-testdb" ant target. This
> > builds a bunch of extra tables that I do not want. Surely I can drop the
> > extra tables... but I would like to know how to just build the core ones
> > into my project (OJB_HL_SEQ, OJB_LOCKENTRY, OJB_NRM, OJB_DLIST, etc...).
> >
> > 2) Is using the OJB sequence manager the only way to get OJB to work with
> > sequences? Several PK fields in my database are autoincrement. Will the
> > OJB create its OWN sequences for these (i.e. if another application relies
> > on the sequence maintained by the RDBMS itself, will it clash with the
> > sequence OJB is maintaining?)?
> >
> > Thanks in advance,
> >
> > Duffy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
--
=====================================
Duffy Gillman
POLIS Systems Programmer
Learning Technology Center
PO Box 210073, CCIT Bldg., Rm. 337
1077 N. Highland Ave.
Tucson, AZ 85721-0073
520.626.0117 (voice)
520.626.8220 (fax)
=====================================
Re: core OJB tables; auto-increment
Posted by Jason McKerr <mc...@nacse.org>.
For the tables that you'll need to keep, refer to
http://db.apache.org/ojb/platforms.html
And no, you don't need to use the default sequence manager. Please
refer to the following for more on sequence manager stuff.
http://db.apache.org/ojb/sequencemanager.html
Jason
On Fri, 2003-04-04 at 15:21, Duffy Gillman wrote:
> Hi,
>
> I am trying to use OJB as part of a web-service. The database may be
> accessed by other software. I need to find answers to the following
> questions:
>
> 1) How do I create the core OJB tables in my database? In the
> documentation I am only finding the "prepare-testdb" ant target. This
> builds a bunch of extra tables that I do not want. Surely I can drop the
> extra tables... but I would like to know how to just build the core ones
> into my project (OJB_HL_SEQ, OJB_LOCKENTRY, OJB_NRM, OJB_DLIST, etc...).
>
> 2) Is using the OJB sequence manager the only way to get OJB to work with
> sequences? Several PK fields in my database are autoincrement. Will the
> OJB create its OWN sequences for these (i.e. if another application relies
> on the sequence maintained by the RDBMS itself, will it clash with the
> sequence OJB is maintaining?)?
>
> Thanks in advance,
>
> Duffy
Re: core OJB tables; auto-increment
Posted by David Warnock <da...@sundayta.com>.
Duffy,
> 1) How do I create the core OJB tables in my database? In the
> documentation I am only finding the "prepare-testdb" ant target. This
> builds a bunch of extra tables that I do not want. Surely I can drop the
> extra tables... but I would like to know how to just build the core ones
> into my project (OJB_HL_SEQ, OJB_LOCKENTRY, OJB_NRM, OJB_DLIST, etc...).
If you are using the PersistanceBroker api in OJB (ie not ODMG or JDO)
and you use RDBMS sequences for primary keys then you should not need
any OJB tables in your database.
You may want columns to handle optimistic locking (eg a timestamp or
integer row version).
> 2) Is using the OJB sequence manager the only way to get OJB to work with
> sequences? Several PK fields in my database are autoincrement. Will the
> OJB create its OWN sequences for these (i.e. if another application relies
> on the sequence maintained by the RDBMS itself, will it clash with the
> sequence OJB is maintaining?)?
You can use the dbms sequence for many dbms, look at the comments in
repository.dtd or the docs.
From a repository I talked about earlier today I use
<class-descriptor
class="org.visres.contact.data.Country"
table="Countries"
>
<field-descriptor
name="countryId"
column="CountryId"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
sequence-name="GEN_CountryId"
/>
<field-descriptor
name="rowVersion"
column="RowVersion"
jdbc-type="INTEGER"
locking="true"
/>
<field-descriptor
name="name"
column="Name"
jdbc-type="VARCHAR"
/>
...
With Firebird.
Regards
Dave
--
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.