关于断开命名管道的Sybase IQ问题(在LOAD TABLE上)

时间:2012-09-11 15:43:07

标签: c++ sybase-iq

我在使用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);

1 个答案:

答案 0 :(得分:1)

这是一个Sybase IQ错误。 使用15.2或使用15.4的最后一个EBR,DisconnectNamedPipe正常工作

相关问题