• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Few EJB Questions

 
AMIT AGGARWAL
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need help on following questions
1) What is the default transaction of the methods in the bean if no transaction attribute is specified.
ans ) Is it supports.
2) When client calls create on home interface of an entity bean what happens first whether ejbobject is created first or first ejbcreate method is called on the bean instance .
3) If statefulsession bean method is involved in transaction will the container passivate it before the transaction iscompleted.
4) Will the entity bean involved in transaction will be passivated.
Please help
Thanks and Regards
Amit Aggarwal
 
Win Yu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone answer this?
 
k kantanu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
if you people ve any doubt, ask me. I ll be more than happy if i can help u guys.I joined this forum from today as i ve finally decided to give Sun architect exam.Thinking to give it by next week.

Hi Amit,
Required is the default transaction attribute.
When client calls create() of home interface,
call goes to ejb container which ll instantiate the ejb bean, set corresponding context to it and then it ll call ejbCreate() on that instance.
I think when a session bean's method is within TX, that bean wont be passivated. And there is no passivation state for entity bean. It has 3 states only, doesn't exist,pooled state,ready state.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the part about ejbcreate is a bit incorrect. It is really dependent on the Application Server about how ejbcreate is handled. It could very well create a new EJBObject upon each call, but most Application Servers pool Stateless Session EJBObjects for performance reason. In this case ejbcreate will just go and get one of the pooled instances.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic