Subject ASP.NET Commit without rollback available?
Author middasgoldtouch
*** MODERATOR MESSAGE ***

This topic largely belongs on the firebird-net-provider list. It has been accepted this time because the poster appears to have a misunderstanding of multi-versioning, which is valid for firebird-support. The poster and responders are asked to take client-specific solutions to the correct list. Subscribe at http://firebirdsql.org/index.php?op=lists

*** END MODERATOR MESSAGE ***

Is it possible to commit a transaction without having a copy created in the database of the old information? I am trying to update large files; doing so causes the database to grow sometimes by over 10x the size of the file I'm appending. I've found this is because of the rollback feature. I've tried setting FbTransactionOptions.NoAutoUndo; however, that doesn't seem to do anything.
Here is an example of the code I'm working with:

internal static void AddFile(string file)
{
FileInfo f = new FileInfo(file);
FbTransaction transaction = aquireDb.BeginTransaction(FbTransactionOptions.NoAutoUndo);
FbCommand cmd = new FbCommand();
cmd.Connection = aquireDb;
cmd.Transaction = transaction;
cmd.CommandText = "INSERT INTO FILES (PATH,MD5,LASTACCESSED,LASTMODIFIED,CREATED,MATCHEDHASH) VALUES ('" + f.FullName + "','md5','" + f.LastAccessTime + "','" + f.LastWriteTime + "','" + f.CreationTime + "',1)";
cmd.ExecuteNonQuery();
cmd.CommandText = "SELECT GEN_ID(FILES_ID,0) FROM RDB$DATABASE";
long id = (long)cmd.ExecuteScalar();
using (FileStream fs = new FileStream(f.FullName, FileMode.Open, FileAccess.Read))
{
BinaryReader br = new BinaryReader(fs);
byte[] data = br.ReadBytes(1024 * 100);
cmd.CommandText = "UPDATE FILES SET DATA = @data WHERE ID = @id";
cmd.Parameters.Add(new FbParameter("@id", 1));
cmd.Parameters.Add(new FbParameter("@data", data));
cmd.ExecuteNonQuery();
cmd.CommandText = "UPDATE FILES SET DATA = DATA||@data WHERE ID = @id";
while ((data = br.ReadBytes(data.Length)).Length > 0)
{
cmd.Parameters["@data"] = new FbParameter("@data", data);
cmd.ExecuteNonQuery();
}
transaction.Commit();
}
}

The file I'm adding is 984KB, the resulting database after adding it is nearly 9MB. Can anyone help me with this?