Entity Bean - Synchronized method


EJB programming & troubleshooting: Entity Bean - Synchronized method

  1. Entity Bean - Synchronized method (1 messages)


      Does a synchronized method in an entity bean lock the table when the synchronized method is called??? Because synchronized method locks the object on which it is called and the entity bean object here is an instance of the table it represents.

    Thanks in advance,
  2. Hi,

    Synchronizing business methods is definitely against the spec. If you have two instances at the same time, the applications server wants to (and should do) the job to synchronize data! See section 25.1.2 of the EJB 2.1 spec.