What are the disadvantages of using persistent connection in PDO?
What are the disadvantages of using persistent connection in PDO?
The main disadvantages of using persistent connections in PDO are:
Persistent connections do not automatically close at the end of a script execution. If a script fails to properly close a connection, it can remain open indefinitely, consuming database resources.
The connection state is not reset before reuse. For example, open and unfinished transactions are not rolled back, table locks are not released, and temporary tables are not dropped when a persistent connection is reused.
Persistent connections can cause issues with database connection limits. If the database has a limit on the number of concurrent connections, and that limit is exceeded by persistent connections from different PHP processes, some requests will fail to connect.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.