How database connection works?

Hi all,

Is there documentation on how the database connection works in rails.
When its released? When its reused? How many time it is kept alive?
That kind of stuff?

Thank you

Rémi