> Hi!
>
> > I know that an entity EJB is shared among all client's.
> > However what does jboss do internally when it encounters a 1000 clients
> > asking for an entity bean with 'PrimaryId=123' for example?
> > Do you 'lock' all the 999 clients until only 1 is working with the bean
at
> a
> > time?
>
> Yes. We use an entity cache with pessimistic concurrency control.
> > This would probably help me to figure out some proper 'getNextID' method
> :)
>
> Note that if you only use an EntityBean to create a generator you will
> probably end up with doing one DB call per generated key, which is bad.
Not necessarily - I would not intend to persist the generator key value on
each call for 'getNetId()' - I would not care too much for the sequence of
the generated numbers rather than their uniqueness.
> By
> wrapping it in a stateless session bean you can "batch" keys.
>
The jboss specific approach that you mentioned in your previuos e-mail is
what worries me :)
Regards,
Kamen