Repository navigation
Commit 9002ef5
committed
ext/pdo_odbc: timeout support
ODBC has both a connection timeout for the connection level and a query
timeout at the statement level. Annoyingly, these are somewhat poorly
defined. The connection timeout, for instance, can be defined as either
a login/connection setup timeout, or as a generic "any action" timeout,
and if the latter, the query timeout may not necessarily be implemented.
Accordingly, because we have no way to differentiate, we have to set
both, and have special handling for the initial connection, as the
setAttribute call won't handle early enough if it only handles initial
connection timeouts. This means changing it after for a connection isn't
relevant for existing statements that have already been constructed;
this commit doesn't add a way to change it for a statement after
changing it on the connection (be it via setAttribute on the statement,
or somehow changing statements from the connection setAttribute).
Also annoying is the difference in behaviour between drivers when a
timeout happens. For example, SQL Server has a query timeout which just
gracefully ends the current query, but Db2i only has a connection
timeout which puts the whole connection into an invalid state (but at
least it should fail a liveness check for a persistent connection). We
don't have much control over this unfortunately.
In the future, we should consider clarifying the PDO timeout attribute
behaviour's on statements vs. connections, or make them separate
attributes, like how PDO_DBLIB has.1 parent 147c8ad commit 9002ef5
2 files changed
Lines changed: 51 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
197 | 208 | | |
198 | 209 | | |
199 | 210 | | |
| |||
341 | 352 | | |
342 | 353 | | |
343 | 354 | | |
| 355 | + | |
344 | 356 | | |
345 | 357 | | |
346 | 358 | | |
| |||
373 | 385 | | |
374 | 386 | | |
375 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
376 | 411 | | |
377 | 412 | | |
378 | 413 | | |
| |||
408 | 443 | | |
409 | 444 | | |
410 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
411 | 449 | | |
412 | 450 | | |
413 | 451 | | |
| |||
473 | 511 | | |
474 | 512 | | |
475 | 513 | | |
476 | | - | |
| 514 | + | |
477 | 515 | | |
478 | 516 | | |
479 | 517 | | |
| |||
523 | 561 | | |
524 | 562 | | |
525 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
526 | 573 | | |
527 | 574 | | |
528 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| |||
0 commit comments