I need to implement locking of a sort on my entity beans.  The semantics 
of these locks are not straightforward; they operate at a "higher level" 
than either database record locks or the built-in ejb locks which JBoss 
uses to protect data integrity.  They are intended to prevent users (who 
are manipulating a linguistics database) from stepping on each others' 
toes.  In particular, these locks:

1. Span multiple transactions; they are explicitly requested and 
released by users.

2. Need to cover arbitrary portions of the data schema with a single 
lock request; i.e., getting a lock on one bean might entail that an 
entire graph of beans connected to this one should also be locked.

3. Need to be robust against partial failure.

This seems like a good usage of the interceptor mechanism.  That is, I 
would write a container interceptor following the existing design 
principles and insert it, I assume, late in the interceptor chain of the 
CMP 2.x entity bean container configuration.  Then, all calls on the 
beans would have to pass through this interceptor before being executed 
and I could block those which aren't allowed (based on my arbitrary 
locking criteria).  This seems far more efficient (and less error-prone) 
than checking for the necessary lock explicitly within every entity bean 
business method.

Questions:

1. Is this a reasonable thing to do, or am I missing something?

2. Is there any more documentation of the interceptor architecture 
beyond the EJB container chapter of the admin book (and of course the 
source)?

3. Any particular hints for making this work right?

Thanks for your time,

Beau



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to