equal
deleted
inserted
replaced
108 print('timeout') |
108 print('timeout') |
109 |
109 |
110 pgm.close_conn('listenconn') |
110 pgm.close_conn('listenconn') |
111 |
111 |
112 |
112 |
|
113 Timeouts |
|
114 -------- |
|
115 |
|
116 In production, it's very important to set reasonable timeouts for both connection |
|
117 and query execution. Application should not freeze when database server gets out of reach. |
|
118 |
|
119 Both timeouts can be set using :meth:`create_conn`:: |
|
120 |
|
121 pgm.create_conn(host='127.0.0.1', dbname='test', |
|
122 init_statement='SET statement_timeout TO 20000;', # in ms, so it's 20s |
|
123 connect_timeout=20, # also 20s |
|
124 isolation_level='autocommit') |
|
125 |
|
126 |
113 Methods |
127 Methods |
114 ------- |
128 ------- |
115 |
129 |
116 .. autoclass:: pgtoolkit.pgmanager.PgManager |
130 .. autoclass:: pgtoolkit.pgmanager.PgManager |
117 :members: |
131 :members: |