geeehhdaa
geeehhdaa

Reputation: 822

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?

Upvotes: 5

Views: 3241

Answers (1)

Michael Borgwardt
Michael Borgwardt

Reputation: 346417

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

Upvotes: 8

Related Questions