users@glassfish.java.net

Re: how to implement a "global" application counter?

From: <glassfish_at_javadesktop.org>
Date: Tue, 25 Dec 2007 05:04:53 PST

Hi,

I agree that the business logic (stored procedure) should not be in the database, which makes your application more complex and less portable.

I also agree that a stateful EJB would be a good candidate for a counter, but only if it doesn't need to be [i]global[/i]. A stateful EJB is tied to a given client. If the counter is global, several clients will probably want to update it.If a client calls a stateless EJB that needs to update the counter, then things get even more complicated...How can we achieve this? There is currently no way to create a unique stateful bean (a singleton) that can be used by other beans (but this features is planned for the EJB 3.1 specification).

 would be very interested to learn how we can do this...
[Message sent by forum member 'ewernli' (ewernli)]

http://forums.java.net/jive/thread.jspa?messageID=251393