9 Commits

Author SHA1 Message Date
Jack Christensen
f5c7ef0957 Add docs regarding Batch.Send deadlock potential
refs #374
2018-01-15 10:37:16 -06:00
Jack Christensen
5789af0b64 Add doc for (*Tx) BeginBatch() 2017-09-25 11:01:30 -05:00
Gaspard Douady
554a4d08ec Merge branch 'master' into master 2017-09-25 10:41:52 +02:00
Gaspard Douady
38e2b9d449 New beginBatch on transaction object
A batch on a tx object does not open and close a transaction itself and
instead use the tx object to ensure the transactionality of the batch

remove unused boolean 'sent' in batch struct
2017-09-25 10:36:41 +02:00
Jack Christensen
53e5d8e341 Fix incomplete selects during batch
An incompletely read select followed by an insert would fail. This was
caused by query methods in the non-batch path always calling
ensureConnectionReadyForQuery. This ensures that connections interrupted
by context cancellation are still usable. However, in the batch case
query methods are not being called while reading the result. A
incompletely read select followed by another select would not manifest
this error due to it starting by reading until row description. But when
an incomplete select (which even a successful QueryRow would be
considered) is followed by an Exec, the CommandComplete message from the
select would be considered as the response to the subsequent Exec.

The fix is the batch tracking whether a CommandComplete is pending and
reading it before advancing to the next result. This is similar in
principle to ensureConnectionReadyForQuery, just specific to Batch.
2017-09-21 11:19:52 -05:00
Jack Christensen
79517aaa0e Fix batch query with query syntax error 2017-07-21 15:22:32 -05:00
Jack Christensen
27ab289096 Use Go casing convention for OID 2017-06-03 11:53:49 -05:00
Jack Christensen
73f496d7de Finish core batch operations 2017-06-03 11:49:27 -05:00
Jack Christensen
fe0af9b357 Happy-path batch query mode 2017-06-02 14:54:17 -05:00