SE_stream_set_write_mode

Enables buffered inserts

Usage syntax

LONG SE_stream_set_write_mode
(SE_STREAM stream,
BOOL buffered);

Parameters
stream The stream handle
buffered TRUE if buffering between the client and server is enabled for write operations; FALSE if disabled
Description

SE_stream_set_write_mode enables or disables buffered writes on the ArcSDE server, which affects the insertion of rows in tables and layers. Buffering allows ArcSDE to optimize the transmission of data between the client and the server. It also optimizes the interaction between the ArcSDE server and the underlying database management system.

When buffered writes are turned off (the default), a call to SE_stream_execute causes an insert to the DBMS to occur immediately. If the application enables buffered writes, data is written to the DBMS only when the internal buffers fill up.

To force the internal buffer to be sent to the ArcSDE server and inserted into the DBMS, call SE_stream_flush_buffered_writes . Other functions that send any existing buffers to the ArcSDE server and insert them into the DBMS are:

SE_stream_close                           SE_connection_commit_transaction
SE_stream_free
                            SE_connection_free

However, these functions will not report any errors that occur during the inserts. Therefore, it is a good idea to call SE_stream_flush_buffered_writes before calling any of these functions.

When buffered writes are turned on, errors on insert (such as a filled extent or violated constraint) may not be reported when SE_stream_execute processes the row. Instead, it is reported when the buffer containing the row is transmitted to the server, and the server attempts to store the row. Use SE_stream_get_ext_error to retrieve error returns for buffered writes.

Note

Buffer writes cannot be enabled when the stream contains a raster attribute column. Because raster data has the potential of being large, it must be inserted and updated through a callout function. The SE_stream_execute function makes iterative calls to the callout function and periodically commits the raster data to avoid overflowing the DBMS log files. For this reason it is impossible to enable buffered writes on the stream since raster attributes must be inserted in a piecewise fashion.  

Returns

SE_SUCCESS
SE_CONNECTION_IN_USE

SE_CONNECTION_LOCKED

SE_FUNCTION_SEQUENCE_ERROR

SE_INVALID_PARAM_VALUE

SE_INVALID_STREAM_TYPE

SE_NET_FAILURE

SE_SDE_NOT_STARTED