• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
These are the worst of times and these are the best of times. And this is the best tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic