Using Data Streams

Created or modified objects (e.g. documents) are transferred "complete" to the EBIS server when saving them. This means that if you add attachments or files in data stream format to documents, these can only be closed after saving the document because they will only then be read.

To avoid problems during client communication, you need to ensure that particularly the data streams provided by EBIS are closed. Only then will you be able to close HTTP connection no longer required, for example.

Example (C#)
// Create document
Documentdoc = session.CreateDocument(...);
FileStreamfileStream = new FileStream(s,FileMode.Open,FileAccess.Read);
try
{
doc.AddBlob("Attachment", info.Name, mimeType, fileStream);
// When the "fileStream.Close();" call is already being executed here,
// calling "doc.Save()" will generate an error.
doc.Save();
}
finally
{
// The stream can and should be closed here.
fileStream.Close();
}