how phalcon manage database connection

Hi, i wasn't able to find an answer to my concern. I'm trying to understand how phalcon manage the connection with database, when it open a connection e when it will be close, whit shared and not connection. Can you help me? Thank you :)

Phalcon uses PDO for it's database connectivity

Phalcon opens a connection when the "db" service is accessed for the first time, depending on whether the service is registered as shared or not it will reuse the same connection or will create a new open every time the service is accessed. Connections are closed when the developer explicitly closes it or when the connection object is not referenced anymore so the GC closes it.

Thank you for your help