users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Fri, 04 Jan 2008 16:51:47 PST

GeneratedValue is cluster agnostic as the value is stored in a (single) database. If you set the increment by one, there will be no caching by the JPA provider.

You solution is simpler because it uses just the counter table, vs. the JPA-based solution that will also require you to add rows to another table which would represent the entity that holds that value.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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