the disadvantages is a transactional one from a multi user perspective;
a good way to model your increments is to immitate what oracle does with its
sequence objects;
Chris Tragas
-----------------------------------------
[EMAIL PROTECTED]
-----------------------------------------
www.atomicmedia.com
-----------------------------------------
> -----Original Message-----
> From: Wei-ju Wu [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 4:51 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [JBoss-user] Auto-Incr
>
>
> Could you please explain me the difference between using an
> AutoNumberBean and just doing a
>
> SELECT MAX(<id>) FROM <tablename> please ?
>
> I think these both approaches are similar and the above
> one is the one I use. Is there a performance disadvantage
> using a select max or can the database optimize the
> access by using the index ? Or could there be conflicts
> with the CMP ?
>
> Wei-ju Wu
>
>
> ----- Original Message -----
> From: "Devraj Mukherjee" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 09, 2001 8:34 AM
> Subject: Re: [JBoss-user] Auto-Incr
>
>
> > Hi,
> >
> > I solved this problem by creating the table with a normal
> integer as the
> > primary key and then writing a AutoNumberBean. The
> AutoNumberBean is
> > another CMP bean which just keeps track of an Integer per
> table. If you
> > want I can send you the code for it as well.
> >
> > Devraj
> >
> > At 23:15 8/07/01 -0700, you wrote:
> > >i'm using mysql for my database and created an
> > >auto-incrementing pk on a table. i wrote an entity
> > >bean which creates a row having a pk value of 0
> > >"zero". mysql maps the value of 0 "zero" to the
> > >last-pk-value + 1. however, when i retrieve my data
> > >through ejb, the pk still contains 0 "zero". im using
> > >jboss as my ejb-container. any help is gladly
> > >appreciated.
> > >
> > >-L. Yeung
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Get personalized email addresses from Yahoo! Mail
> > >http://personal.mail.yahoo.com/
> > >
> > >_______________________________________________
> > >JBoss-user mailing list
> > >[EMAIL PROTECTED]
> > >http://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user