From the devart docs it says that:
Note that writing data to OracleLob object results in immediate data transfer to server.
But it doesn't mention how this actually works. For instance, in the following example (from the docs):
public void UploadBlob(OracleConnection myConnection)
{
FileStream fs = new FileStream("D:\\Tmp\\_Water.bmp", FileMode.Open, FileAccess.Read);
BinaryReader r = new BinaryReader(fs);
myConnection.Open();
OracleLob myLob = new OracleLob(myConnection,OracleDbType.Blob);
int streamLength = (int)fs.Length;
myLob.Write(r.ReadBytes(streamLength), 0, streamLength);
OracleCommand myCommand = new OracleCommand("INSERT INTO Pictures (ID, PicName, Picture) VALUES(1,'Water',:Pictures)", myConnection);
OracleParameter myParam = myCommand.Parameters.Add("Pictures", OracleDbType.Blob);
myParam.OracleValue = myLob;
try
{
Console.WriteLine(myCommand.ExecuteNonQuery() + " rows affected.");
}
finally
{
myConnection.Close();
r.Close();
fs.Close();
}
}
... then according to the docs, data should be sent to the database server on line myLob.Write(r.ReadBytes(streamLength), 0, streamLength);
- but at this point the database does not know in which "record" the blob is to be stored, so I am a bit in doubt on how this actually works - where is the data written to? Is there some kind of in-memory staging area where the data is streamed to, and depending on if I commit or rollback, the data is made available in the specific record (or removed if rolled back)?