users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Mon, 24 Dec 2007 11:07:00 PST

I would say that the RDBMS-based solution would actually be far simpler and more reliable than any distributed app-tier based solution. Synchronizing the value across all app servers (by either using stateful beans or some distributed cache) will probably be problematic since distributed locking is very performance-penalizing and without it duplicate values may be generated while the cache replicates across all nodes. All RDBMS's have identity/auto-incrementing table field functionality, you lock that row, update and then read the value followed by unlocking, you can do it either from the app tier or through a database store procedure.
[Message sent by forum member 'tambrozie' (tambrozie)]

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