Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HF mock exam question..

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which statements are true for stateless session bean instances?
a. Any instance can be used for any client
b. conversational state must be retained across methods
c. conversational state must be retained across transactions
d. they can be passivated.
e. they do not support transactions.
according to the book, the Answer is A. I agree, but:
b, c: there's no conversational state in stateless session beans.
d: stateless session beans are not passivated
e: I was tempted to select this option, because since stateless beans don't hold conversation, how is the transaction managed?
How are you supposed to keep track of a transaction if every remote call is treated as a new one, and not attached to the previous one?
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andres,
I do not know if I have understood ur question correctly. I am not able to see a relation between transactionality and the converstational state of a client.
Transactions are maintained by the Container.
If I call a method foo1() on the stateless session bean and if this method updates table t1 and calls another method foo2(), which updates another table t2 and calls another method foo3(). If the method foo3() throws an exception for some reason, all the tables are rolled back. Aren't they?
(if the transaction attribute is Required).
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might be right Vish, I hadn't thought about that situation.
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic