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