I have a Bean that starts some threads with a database connection. What can I do to make sure that these connections are closed when the user moves? Can I define some form of "destructor" for JSF beans?
@PreDestroy annotation is what you are looking for.
@PreDestroy