SybaseIQ15.4で名前付きパイプを使用してバルクロードを実行しようとすると問題が発生します。コードはC++で、Windowsをオンにします。
バルクの最後に、バッファー(FlushFileBuffers
)をフラッシュした後、名前付きパイプ()を切断しようとすると、ドキュメントに次のように表示されますがDisconnectNamedPipe
、実行中のLOAD TABLE query
クラッシュが発生します。"I/O Error on file \\.\pipe\pipename"
"The pipe writer must call FlushFileBuffers( ) and then DisconnectNamedPipe( ). (If you do not, Sybase IQ reports an exception from hos io::Read( ).) This issues a PIPE_NOT_CONNECTED error, which notifies Sybase IQ that the pipe was shut down in an orderly manner rather than an uncontrolled disconnect"
を削除するDisconnectNamedPipe
と、バルクロードは問題ないことに注意してください
これがコードの履歴書です、あなたの助けに感謝します
hPipe = CreateNamedPipe(strPipeName, PIPE_ACCESS_OUTBOUND, PIPE_TYPE_BYTE, 255, 65536, 65536, 100, NULL);
ConnectNamedPipe(hPipe, NULL);
// in another thread: LOAD TABLE myTable (...) USING CLIENT FILE strPipeName ...
WriteFile(hPipe, ...);
FlushFileBuffers(hPipe);
DisconnectNamedPipe(hPipe); // I/O Error on file \\.\pipe\pipename
CloseHandle(hPipe);