users@glassfish.java.net

Re: How to build something like a request counter for a stateless session b

From: Witold Szczerba <pljosh.mail_at_gmail.com>
Date: Wed, 12 Sep 2007 10:31:35 +0200

2007/9/12, glassfish_at_javadesktop.org <glassfish_at_javadesktop.org>:
> Hi Witold,
>
> Isn't this [b]really[/b] slow?

Did you try this already or just estimating?
What does your service really do, that one more database statement is
going to slow it down??

> Secondary storage is slow, most of the time and
> every request must wait until it can update the data. (Only one request at a time can increment the counter)

Even if you are right, as you said: "every request must wait..." -
waiting does not consume processing power, if instance A is waiting
for something, instance B can be used for next request, if B is
waiting, the C, D,E or dozen other instances are ready to be used.
This is what EJB server provides, ensure your service pool is big
enough and you are done.

Of course you can try inventing something ...new, but... when the
thing you are going to invent will become more and more oval, and you
find out that its circumference to diameter ratio is proceeding to the
3.14... then stop, because that thing is already invented :)

Regards,
Witold Szczerba