This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Release resource in @remove method

 
Fei Wong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have study the EJB book saying that it should release resource in @predestroy method.
But I have a question that can the resource release in @remove method?
 
Romeo Son
Ranch Hand
Posts: 92
Android Eclipse IDE Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The @remove annotation is used only on Stateful session beans methods. After the method annotated with @remove returns, the instance is destroyed by the container. This is because with Stateful session beans every client gets its own instance and this way the performance is greatly improved. (Think in this scenario if every instance would need to wait a timeout to be destroyed)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic