What's true about Container suppor for messagge-driven beans?
The Container must ensure that the bean instances are non-reentrant.
What does reentrant mean?
Is there other ejb type that use reentrant option?
SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
A good workman is known by his tools.
A loopback is where Bean #1 calls methods on Bean #2 and Bean #2 turns around and calls methods back on Bean #1, all within a single thread of control.
This means if you allow reentrancy you also allow multithreaded (and multiclient) access of your bean which can cause serious data issues!
Vince Hon<br /> <br />SCJP 1.4 | SCWCD | SCBCD <br /><a href="http://vincehon.homeip.net:8000/VJW" target="_blank" rel="nofollow">http://vincehon.homeip.net:8000/VJW</a>
Originally posted by Vince Hon:
Hi, Marc
As u said the loopback "all within a single thread of control". Why allow reentrancy can allow multithreaded (and multiclient) ?
thx !
Re-entrant entity beans must be programmed and used with caution. First, the Bean Provider must code the entity bean with the anticipation of a loopback call. Second, since the container cannot, in general, tell a loopback from a concurrent call from a different client, the client programmer must be careful to avoid code that could lead to a concurrent call in the same transaction context.
Concurrent calls in the same transaction context targeted at the same entity object are illegal and may lead to unpredictable results. Since the container cannot, in general, distinguish between an illegal concurrent call and a legal loopback, application programmers are encouraged to avoid using loopbacks. Entity beans that do not need callbacks should be marked as non-reentrant in the deployment descriptor, allowing the container to detect and prevent concurrent calls from clients.
A good workman is known by his tools.
The container cannot, in general, tell a loopback from a concurrent call from a different client, the client programmer must be careful to avoid code that could lead to a concurrent call in the same transaction context.
Vince Hon<br /> <br />SCJP 1.4 | SCWCD | SCBCD <br /><a href="http://vincehon.homeip.net:8000/VJW" target="_blank" rel="nofollow">http://vincehon.homeip.net:8000/VJW</a>