Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • 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.
 
What's that smell? I think this tiny ad may have stepped in something.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic