Balaji Varadarajan

Greenhorn
+ Follow
since Oct 18, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Balaji Varadarajan

I forgot to mention the book "Head First EJB" that I was using. I hope you have implied the errata for this book only. If that is the case, I did find some error related to create() call but that was for Stateful Session bean and not for Stateless session bean.

Thanks,
Balaji.V
Dear all,

I have 2 questions regarding what is allowed/disallowed for a Stateful/Stateless bean. It would be great if someone could answer them.

a.

1. setRollbackOnly() and getRollbackOnly() of the SessionContext.
2. Accessing other enterprise beans and resource Managers.

The EJB spec says (1) and (2) cannot happen if the container does not have a meaningful transaction context. But, I could see that the ejbCreate, ejbRemove, ejbActivate, ejbPassivate methods for stateful session bean allows (2) but disallows (1). How is (2) allowed if the container is in unspecified transaction context ?

b. The EJB spec says the stateless session bean can get a reference to EJBObject in its ejbCreate() method. My question is :
For a stateless session beans, Only when client calls create() on the Home, will the EJBObject be created ( atleast that what we should visualize) and the bean creation is not tied to client's create() call ( i.e the bean could have been in the pool long before the client's create() call.) If this is the case, there wont be any EJBObject during ejbCreate. So How can SessionContext.getEJBObject() possible during ejbCreate Call ? Let me know if I am right on my assumptions.

Thanks,
Balaji.V