The most likely explanation is that it isn't persisting: a
static
variable is "local" to the process and exists only while that process is running. The next time the process is created, the static variable starts from the initial value again.
So unless the static variable is stored in a DB, or a config file it won't be persisted and will always start from zero.
We can't see the rest of your code, but a private static int wouldn't be automatically persisted via the Entity framework:
Entities - The Java EE 6 Tutorial[
^] - or at least, that's the way I read it!