On Oct 18, Aaron Mulder quoth:

> On Wed, 18 Oct 2000, Rickard Oberg wrote:
> > > 3) How do we avoid clashing with keys generated by the DB itself or other
> > > software?
> > 
> > By allowing the initial counter to be given. If you already have a bunch of
> > keys in the db then simply set the initial one to a number higher than
> > what's already created.
> 
>       I disagree.  I don't think we should assume that jBoss is the only
> user of the database.  In general, I think we have to assume that other
> apps may be updating at the same time, and even triggers within the DB and
> so on.
>       Now, with a compliant DB, we can fetch a number of values all in a
> row instead of one at a time as requests come in, but I don't think that
> really buys you anything.  In that case, we're not getting a range, just
> calling "nextval" 10 times in a row.
>       Ah - perhaps you were just talking about the non-compliant DB,
> where we have to fake it by writing our own table or something.  In that
> case, then you could certainly grab a bunch of IDs at once by just upping
> the "last value" by 10.
>       I think it would be better to do this as an MBean instead of an
> EJB, though - it's really a service of the server, not a co-existing app
> which has security and transaction settings and so on.  And I kind of
> liked the suggestion that you just look in JNDI under "system/nextID" or
> whatever and get back the next ID directly...  Saves you from dealing with
> all that factory crap... :)

I would implore anyone interested in this topic to go back and read the
back and forth Tom White and I had on this very issue a couple of weeks
ago.  Offering a default ID service in jboss isn't a simple "yeah we
should have that" type decision.  There is no "right" answer to this
question and by providing a solution in the distribution you will be
endorsing a specific solution that will be used without the developer
considering it's applicability.

I fully support the notion of people writing database specific mbeans (or
whatever) to provide this functionality but think it would be a Bad
Idea(tm) to provide it in the distribution. Encourage people to build
appropriate solutions for different problems rather than a
one-solution-fits-all in the distribution.  Then provide a FAQ reference
so people can fetch the Postgre or Oracle, integer or long, standalone or
clustered, A or B, this or that version of the mbean as is
appropriate.

A primary key service *is* appropriate for the container but it is *not*
appropriate for the container manufacturer.  Such a decision is very
application and domain specific.

C=)

--------------------------------------------------------------------------
    The fact that no one understands you doesn't mean you're an artist.
--------------------------------------------------------------------------
Caskey <caskey*technocage.com>       ///                   TechnoCage Inc.
--------------------------------------------------------------------------
           Oh no! Space monkeys are attacking! -- eddie izzard




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to