February 2020
Intermediate to advanced
734 pages
38h 13m
English
Database applications and object-relational mappers that use prepared queries will have a problem if we enable transaction-level pooling. Once a statement is prepared for execution, it can be reused until it is deallocated. We know that connections are reset between sessions by default, so these prepared statements are lost. We can fix this by changing server_reset_query in /etc/pgbouncer/pgbouncer.ini to the following:
server_reset_query =
By setting a blank value, objects allocated between transactions can persist. However, this also means that the application should check for a prepared statement before creating it. Since the connections are recycled, the application may be assigned a connection where ...
Read now
Unlock full access