What I want to achieve is:
1) Read the maximum value from the id coulmn in table X
2) Store this value (let's call it Y) in a non-jboss specific and reliable
way
3) To get an incremented value of Y from every BMP entity bean in my
application.

With this approach I will only 'touch' the database once.
However it seems that 2) is a real problem?
What will happen if 10 clients require an unique value for Y in the
'standard session pool ' case? They will obviuosly have to  'talk' to a
singleton (and thus jboss specific way which is not what I want - see 2) )
type bean in order to get a proper values.

Regards,
Kamen.

----- Original Message -----
From: "Rickard Oberg" <[EMAIL PROTECTED]>
To: "jBoss Developer" <[EMAIL PROTECTED]>
Sent: Saturday, September 30, 2000 9:27 PM
Subject: Re: [jBoss-Dev] More questions


> > > So you're going for BMP then? Or do you want to do this with stateless
> > > session beans only?
> > > > > By
> > > > > wrapping it in a stateless session bean you can "batch" keys.
> > > > >
> >
> > Before I answer this question please let me know - does the entity bean
> > looses al it's state when it goes back to the pool and under what
> > circumstances the framework decides to get it back in the pool?
>
> The instance is not "reset" when it is put back into the pool (i.e. when
it
> is passivated). However you should not rely on that kind of state, of
> course.
>
> > Why do you think that using a 'singleton' statless bean would 'be
> > introducing an unnecessary bottleneck '?
>
> Because if 10 clients try to access it at the same time 9 will have to
wait,
> since access to the instance have to be serialized (in accordance with the
> EJB spec). In your case I think you can use the standard session pool with
> many instances, since you do not require the generated keys to be in
order.
>
> /Rickard
>
>
>
>
>


Reply via email to