This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
If follwoing are the bean things (extracted from Heads First for EJB):
1. get reference to EJB Home 2. get reference to EJB Object 3. get security information from client 4. get primary key 5. force a transaction to rollback(CMT) 6. find if a transaction is already set to rollback(CMT) 7. get transaction reference and call methods on it(BMT)
Which are allowed to be done in : 1. stateless session bean's ejbRemove? 2. ejbRemove and unsetEntityContext of entity bean (CMT). 3. onMessage in message driven bean (ofcourse 1, 2, 3, 4 are already ruled out).
Q1. For ejbRemove method in stateless session bean: These are allowed 1. get reference to EJB Home 2. get reference to EJB Object 7. get transaction reference and call methods on it(BMT) These not are allowed 3. get security information from client ( stateless session beans doesnot have any client specific information ) 4. get primary key ( this cannot be called for session beans) 5. force a transaction to rollback(CMT) ( scince ejbRemove is running in a unspecified transaction , this is not allowed) 6. find if a transaction is already set to rollback(CMT) ( scince ejbRemove is running in a unspecified transaction , this is not allowed)
Q2. For ejbRemove method in entity bean
All are allowed except 7. get transaction reference and call methods on it(BMT)-- because entity bean is always Container Managed.
For unsetEntityContext method in entity bean This method is called when the entity object(not representing any entity in the persistent store) is in the pool. Only 1. get reference to EJB Home is allowed here.
Q3.onMessage in message driven bean (ofcourse 1, 2, 3, 4 are already ruled out).
This one you have already answered. 5 & 6 for CMT and 7 for BMT are allowed.