• 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
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

what if client explicitly call EJBHome.remove()

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In practice I don't see an application explictly do so since the lifecycle is automatically managed by the container. However, what if the client DOES so since it is legal.
Another related question: if the bean is already in the pool, will ejbCreate() be invoked?
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stateless/StateFull Session ? Entity ? Both ? Please narrow ( the question, not the JNDI reference (J2EE joke. not funny...) )
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBHome provides two remove methods: remove(Handle handle) and remove(Object primaryKey).
I think you can guess what they do.
 
Denis Wang
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ejbRemove() method is invoked when a client invokes a remove operation on the enterprise Bean's home interface or the EJB object's remote interface.
EJBHome.remove(handle/PrimaryKey) is self-explaining, but EJBObject has remove() with no parameter.
 
k space
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ejbRemove() method is invoked when a client invokes a remove operation on the enterprise Bean's home interface or the EJB object's remote interface.


Not always true, as different beans have different lifecyles and are managed by the container.
For example, when a client invokes the remove() on a stateless session bean's remote interface, the container may do nothing.
ejbRemove() only gets called when the container decided to remove the object permanently. For CMP entity bean, the corresponding database row will also be removed.
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Master Gardener Program
https://coderanch.com/t/771761/Master-Gardener-Program
reply
    Bookmark Topic Watch Topic
  • New Topic