Subject Re: [firebird-support] FbBackup Holding File Open
Author Thomas Steinmaurer
Steve,

> I'm using C# with Firebird v2.51 and FirebirdClient v2.7. I'm creating a
> backup with FirebirdSql.Data.Services.FbBackup and the resulting Fbk file
> appears to be valid. However, when I then try to add the resulting fbk file
> to a zip archive (using DotNetZip), I get an error "The process cannot
> access the file 'xxxxx.Fbk' because it is being used by another process.".
> This error is thrown by DotNetZip when I execute the Save() method.
>
>
>
> Why would the file be in use when the FbBackup object is out of scope in
> another method?
>
> Is there a way to resolve this and force FbBackup to close the backup file?
>
>
>
>
> I've tried forcing garbage collection (GC.Collect()) and this had no effect.
>
>
>
> My backup code is fairly straight forward.
>
>
>
> private void BackItUp(string backupFile)
>
> {
>
> FirebirdSql.Data.Services.FbBackup backup = new
> FirebirdSql.Data.Services.FbBackup();
>
> backup.ConnectionString = GetConnectionString();
>
> backup.BackupFiles.Add(new
> FirebirdSql.Data.Services.FbBackupFile(backupFile, this.m_PageSize)); //
> 4096
>
> backup.Verbose = false;
>
> backup.Options = FbBackupFlags.IgnoreLimbo;
>
> backup.ServiceOutput += FirebirdServiceOutput;
>
> backup.Execute();
>
> }
>
>
>
> Thanks for any help.

You'd best move Firebird .NET related questions to the
Firebird-net-provider list. Check out the various support lists here:
http://www.firebirdsql.org/en/mailing-lists/


Regards,
Thomas