static variable in EJB


EJB programming & troubleshooting: static variable in EJB

  1. static variable in EJB (2 messages)

    Why we must not use read/write static fields.
    But using read-only (final) static fields is allowed.


    Threaded Messages (2)

  2. Thread synchronisation[ Go to top ]

    Because you are not allowed to implement your own synchronisation within EJBs.

    If you trying to emulate a static counter, then good luck :)

    One nasty work around is to have a BMP entity bean which actually doesn't do any persistence.
  3. Multiple JVMs.[ Go to top ]

    EJBs were designed to be distributed, making static synchronisation impossible (unless you come up with a way to have multiple servers running the same JVM! ).

    Randy Maier,
    Versant Corp.