Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoking action when bean destroyed

I have a Bean that runs some threads with database connections. What can I do to make sure those connections are closed when the user navigates away? Can I define some form of "destructor" for JSF beans?

like image 706
geeehhdaa Avatar asked May 26 '11 10:05

geeehhdaa


1 Answers

The @PreDestroy annotation is what you're looking for.

like image 155
Michael Borgwardt Avatar answered Nov 14 '22 20:11

Michael Borgwardt