users@glassfish.java.net

Re: Concurrent acess to stateful sb from rich client/design question

From: <glassfish_at_javadesktop.org>
Date: Fri, 12 Oct 2007 13:17:48 PDT

Hi Dale,

Unfortunately this use-case is not supported very well in the current EJB spec. We are planning on fixing that in EJB 3.1 (http://jcp.org/en/jsr/detail?id=318) in at least two ways :

1. Adding a Singleton component that is designed from the ground up for concurrent access

2. Adding metadata to force serialized behavior for concurrent access to a stateful session bean

For your EJB 3.0 app, the easiest thing is probably to just add retry logic in the client. The fact that the ConcurrentAccessException is specific to stateful session bean concurrent access means you can identify that case exactly. The production of the ConcurrentAccessException will not cause the target Stateful Session bean to be destroyed. Obviously this is not an ideal solution from a performance or code complexity perspective, but at the very least it's portable.

 --ken
[Message sent by forum member 'ksak' (ksak)]

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