> Could you please let me know what's the best way to generate uniquie ids
for
> the primary key in jboss. Do I have to use a separate bean for this
purpose
> and if  'yes' then what kind of EJB?

Tricky one. In *general* there are no "best ways" or "have to"'s. You might
want to read the primay key generation thread in this forum, and the threads
on theserverside.com with regard to this topic.

I am currently planning on adding an id generator to the "jbosstest" module,
both to act as a ground for discussion, and for people to use in their own
applications. I will most likely opt for one stateless session bean and one
CMP EntityBean to solve this. We will see how it turns out.

> Can I use an instance variable in a stateless session bean as a
> application-wide global variable that all the beans can see as a
consistent
> one?

Generally no, becuase there may be several instances of a stateless session
bean. However, since we have a special stateless session bean pool for
singletons (i.e. one which only contains one single instance) this is
possible to do by using that pool. Create a new container configuration to
use with your bean, and be sure to make it use this special pool.

/Rickard



Reply via email to