users@glassfish.java.net

Re: synchronizing methods in ejbs - stateless

From: <glassfish_at_javadesktop.org>
Date: Tue, 19 Feb 2008 06:43:48 PST

Hi,

A transaction shouldn't prevent other clients from invoking that method. A transaction prevents other clients from seeing the modifications to the database until your transaction (or your method) finishes.

If you just want to block other clients from accessing that method, you could try using a semaphore (for instance a singleton class that each client running that method makes a request to, to check if they can run). However, this might result in some performance issues.

Kolos
[Message sent by forum member 'kolos' (kolos)]

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