我在尝试使用 SybaseIQ 15.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);