Catching HTTP response event

I am building a Node web application (using Express) and to keep everything as DRY as possible, I automatically acquire database connection for each request but I also need to release it (back to the pool).

I could do that manually in every route but that would be just polluting the code. I figured that I should listen to server events and release it once response is either finished generating or sending. What options do I have? What events (and inside which object (app, request or whatever) are triggered when response is complete?

res is inherited from EventEmitter, and can use default events as well as you can emit own ones.
So one of the most common would be finish (in node.0.8.12 and older end) event:

res.on('finish', function() {
  // request processing finished
});

You can attach that event for all requests if you want, or to specific early in their roots.
Additionally you can create middleware, that would get DB connection, and attach finish event and possibly timeouts. And then all you will need is to add that middleware into routes, so minimum of repetitive coding.

In mean time, I would recommend you not to create DB connection for each request, as it is a big overhead and unnecessary use of sockets as well as IO handlers. You can freely use onse single connection, and it will be as efficient from performance point of view.