Javadoc
Anticipated flow of a COPY TO STDOUT operation:
CopyManager.copyOut()
->QueryExecutor.startCopy()
- sends given query to server
->processCopyResults():
- receives CopyOutResponse from Server
- creates new CopyOutImpl
->initCopy():
- receives copy metadata from server
->CopyOutImpl.init()
->lock() connection for this operation
- if query fails an exception is thrown
- if query returns wrong CopyOperation, copyOut() cancels it before throwing exception
CopyOutImpl.readFromCopy()
->QueryExecutorImpl.readFromCopy()
->processCopyResults()
- on copydata row from server
->CopyOutImpl.handleCopydata() stores reference to byte array
- on CopyDone, CommandComplete, ReadyForQuery
->unlock() connection for use by other operations