This is a bad question, although figuring out why it had to be a bad question definitely helped to pound more info on transactions and exception handling into my brain! The relationship between transaction handling and exceptions has to be the one of the more arcane parts of the
EJB spec. See spec section 18.3.1, table 15, pgs 375-376.
First, you could argue that there is unnecessary potential for confusion in the wording because there are two different ways to interpret the question:
A. "here is a statement of fact that claims to be true",
"now I'll ask you if such a thing is possible in the first place"
(in other words, can you recognize when a question is lying to you)
B. "here is a statement of prevailing conditions",
"now I'll see if you know what happens next under such circumstances"
At first I expected that one interpretation would at least yield a reasonable
test of knowledge and the author was unaware of the other possible interpretation, but it turned out that both interpretations have problems.
Case A:
In this interpretation you are being tested if you know the answer to "is it possible for the session bean to receive a RemoteException if the remote bean's container performs a transaction rollback?". The answer is both true and false. False if the remote bean executed in the client bean's transaction and did a rollback (1st row of Table 15 in the spec), true if the remote bean executed in its own transaction or if the problem happened during a callback executing in an unspecified transaction context (2nd and 3rd rows of Table 15). The question doesn't provide enough info, so both true and false are possible conclusions and the question is thus arguably bad under interpretation A.
Case B:
So in this interpretation you are being asked 'what will the container do to the caller of the session bean on a rollback?'.
Let "B1" be a client bean using the session bean, let "B2" be the session bean ("B3" would be the remote bean used by the session bean, but we don't really have to factor anything about B3 into understanding this case). If B1 and B2 execute in different transactions, and B1 is a remote client of B2, then on a rollback the container will throw RemoteException (row 1, Table 15). If B1 isn't a remote client of B2, it'll never receive a RemoteException. If B1 and B2 share a transaction, it won't receive a RemoteException for a business method transaction rollback, although it could receive one because of communications problems or a container callback failure if the callback executes in an unspecified transaction context.
So no matter how you slice it, the question supports both a true and false answer. Bad as a true/false question, good as an exercise. :-)
[ March 07, 2004: Message edited by: Reid M. Pinchback ]