From: Gerdus v. Z. <ger...@gm...> - 2016-02-03 08:07:18
|
What I do in my code is issue the database shutdown command(see http://firebirdsql.org/manual/gfix-dbstartstop.html) after closing all connections I can. Imports FirebirdSql.Data.Services Dim s As New FbConfiguration() s.ConnectionString = Me.Connection.ConnectionString s.DatabaseShutdown(FbShutdownMode.Forced, 1) 'aborts all connections and transactions, 1 second timeout 'Copy File,etc s.DatabaseOnline() 'bring database online again But if you want to make a backup... FbBackup is of course much better and safer. Dim bkp As New FbBackup() bkp.BackupFiles.Add(New FbBackupFile(bkpfn, Nothing)) bkp.ConnectionString = constr bkp.Options = FbBackupFlags.IgnoreLimbo + FbBackupFlags.Expand 'so that program blocks till complete bkp.Verbose = True AddHandler bkp.ServiceOutput, Sub(sender As Object, e As ServiceOutputEventArgs) End Sub RaiseEvent BackupProgressEvent(String.Format("{0}: Creating Database Backup...", database.DatabaseName), 0) bkp.Execute() On Tue, Feb 2, 2016 at 8:26 AM, SUKHEN DASS <suk...@ya...> wrote: > its a single user application which only i am using and i am using > this code before IO.File.Replace is being called... which i forgot to > include in the code > For iLoop = 0 To 100 > Application.DoEvents() > Next > > > On Tuesday, February 2, 2016 11:28 AM, Jiří Činčura <ji...@ci...> > wrote: > > > Calling `FbConnection.ClearAllPools` is enough. You don't have to call > anything else. Though you might give server few ms to release the file - > it's not guaranteed that closing all connections will immediately > release the file. > > -- > Mgr. Jiří Činčura > Independent IT Specialist > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > > |