Pool Database Connections #27
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Database functions currently create a unique connection for every transaction:
conn = get_db_connection()
In addition to code duplication, this has a significant overhead and could lead to performance issues. We can instead start one connection to the database on application startup and share it between all database functions via a global variable.
The database connection can also be set to enable autocommit to further cut down on redundant code.