• 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

Remove methods in component or home interface

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm completely confused if it is possible to call a remove method on the home or component
interface of a stateful session bean within a transaction.

What causes the confusion are the following contradicting qoutes form core spec:

core spec 4.4.4, page 82:

If a session bean instance is participating in a transaction, it is an error for a client to
invoke the remove method on the session object's home or component interface object. The
container must detect such an attempt and throw the javax.ejb.RemoveException to the client.
The container should not mark the client's transaction for rollback, thus allowing the client to recover.


In contrast core spec 4.4 on page 76 states:

When the client calls a business method of the bean that has been designated as a Remove
method, or a remove method on the home or component interface, the container invokes PreDestroy
lifecycle callback interceptor method(s) (if any) for the bean instance after the Remove method
completes. This ends the life of the session bean instance.


So, is it allowed to call a remove method on the home or component interface or not ?
Any help is appreciated.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"4.4.4 Restrictions for Transactions" are restrictions. It means that what is stated in 4.4 in true, except in these special cases. But the part you are referring to is true for EJB2.x only (calling remove() on home or component interface)
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Christophe.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic