• 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Message Driven Bean EJBRemove()  RSS feed

 
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am testing a Message Driven Bean. Please at what point does the EJBRemove() method gets called. Because i am planning to open a database connection in the ejbCreate() method and also add code to close the connection in the ejbremove method
 
author & internet detective
Posts: 39083
714
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abiodun,
See the bottom of Sun's tutorial for the lifecyle of an MDB. Basically ejbRemove() gets called when the container decides it is done with bean and wants to make it available for garbage collection.

That's a long time to keep a connection open. Since an MDB is stateless, the time between ejbCreate and ejbRemove could be days. Or even longer!
 
expectation is the root of all heartache - shakespeare. tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!