• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Clarification-REgarding Sharpen your Pencil

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HF EJB: PgNo:323:

Sharpen Your Pencil EJB Entity Bean)

I want to confirm the answers for the question:

1. The Client Calls this method to tell the container that he(client) is done using the bean's EJB Object reference:

2. This method is called when the bean goes back to the pool, after an entity is deleted from the database:

3. This method is called immediately after the bean's constructor runs:

4. This Method is called on the bean when the bean is in the pool and the client invokes a business method on the component interface.

My Answer:

1.ejbPassivate()
2.ejbRemove()
3.setEntityContext()
4.ejbActivate()

Please correct me if iam wrong..


Thanks
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1 - remove
since ejbRemove is never called by Client but Container. In case of entity bean calling remove means client is done not just with the EJB Object but with the entity in the database also which will be permanently deleted.

2 - ejbPassivate
 
vinod balaji
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Davendra for your reply.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. No methods for this kind of task

2. ejbRemove()

3. setEntityContext()

4. ejbActivate()
[ February 28, 2007: Message edited by: Suresh Babu Shanmugam ]
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suresh,
For #1 is exactly what remove does.There is very good explanation of remove in HF book.

regards.
 
Suresh Babu Shanmugam
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rahul,

1. The Client Calls this method to tell the container that he(client) is done using the bean's EJB Object reference:

Here, Client is done with EJBObject reference not with entity. So if remove method is called, Entity in Database will be deleted. #1 is applicable for Session Bean, where if client is done, he/she can call remove method. it is not possible with Entity Bean. No method for doing so in Entity Bean. :-)
 
Rahul Toaikani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You got me there

Entity Bean's remove() will actually remove entity from the database.You are correct, there is no way client can specify that he is done with the EJBObject(which can be representing session or entity or message-driven)
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
unsetEntityContext() method says, its done with the bean it is dealing with.

Thanks,
Ugender
 
reply
    Bookmark Topic Watch Topic
  • New Topic