Question

I have an issue trying to perform bulk load using named pipe on SybaseIQ 15.4. The code is C++ and turns on Windows.

At the end of the bulk, after flushing the buffer (FlushFileBuffers), when I try to disconnect the named pipe (DisconnectNamedPipe), the running LOAD TABLE query crash with an "I/O Error on file \\.\pipe\pipename" although the doc says:

"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"

Note that if I remove the DisconnectNamedPipe, the bulk load is fine

Here is a resume of the code, Thank for your help

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);
Was it helpful?

Solution

It was a Sybase IQ bug. Using 15.2 or using the last EBR for the 15.4, the DisconnectNamedPipe works fine

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top