Win a copy of Microservices Testing (Live Project) this week in the Spring 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

what will happen if an entity bean throws a EJBException inside ejbPassivate?

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If an entity bean's ejbPassivate is called inside an transaction and the mehtod throws an EJBException, what will happen? Sure this is transparent to client. What a bean provider should do?
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javax.ejb.EJBException is a runtime exception, so it isn't an application exception, so wouldn't the usual rules for exception handling in bean methods apply? I'd expect the bean to get composted (i.e. transition to the 'does not exist' state). I think spec 18.3.3, pgs 378-379 apply. While the spec culls out container callbacks for special attention, it looks like it follows the same principles of runtime-exception-equals-bean-death as business methods do.
 
Jack Zhou
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, so generally bean provider is neither required nor is able to do something meaningfull.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you always have the option of catching an exception that was thrown to you and doing something about whatever the problem is, but if you decide to let the runtime exception propagate up the call stack, your bean instance is toast.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic