Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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.
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic