From: <meg...@ya...> - 2004-02-05 02:36:46
|
Hello Carlos, This is what I've found which is one step near to the guess I'd made in my first mail, i.e., some connections are alive when I try to backup the database. My connection string for the database was like this "user=<user>;password=<password>;database=<dbfile>;datasource=localhost;port=3050;Connection lifetime=5;Pooling=true" I changed the pooling from true to false, and now the backup worked(with and without the code u'd added), even after I'd made a successful query to the database, before this backup. Then I tried a'ain with pooling as true, but make a Thread.Sleep(6000), before using FbConfiguration.DatabaseShutdown(FbShutdownMode.Forced,0) and FbConfiguration.DatabaseOnline()(as per the code in previous mail). But this time 4 out of ten times it did fine and rest gave error, the error number being 152 along with 133 and 233. Hope now u can make what all this is for. Let me know in case any other test case is required. Just to confirm, if backup/restore are called without any prior connection, none error comes. Thanx. Mahesh. Carlos_Guzmán_Álvarez <car...@te...> wrote: Hello: > Can u give me any idea, why this could be happen? Huummmm .... Can you make a little test ?? anything like this: FbBackup objFbBackup = new FbBackup(); objFbBackup.UserName = user; objFbBackup.UserPassword = password; objFbBackup.Database = dbFile; objFbBackup.BackupFiles.Add(new FbBackupFile(dbBackFile, 4096)); objFbBackup.Options = FbBackupFlags.IgnoreLimbo; objFbBackup.Verbose = true; objFbBackup.Start(); while((lineOutput = objFbBackup.GetNextLine()) != null) { // Console.WriteLine(lineOutput); } objFbBackup.Close(); FbRestore objFbRestore = new FbRestore(); objFbRestore.UserName = user; objFbRestore.UserPassword = password; objFbRestore.Database = dbFile; objFbRestore.BackupFiles.Add(new FbBackupFile(dbBackFile, 4096)); objFbRestore.PageSize= 4096; objFbRestore.Options = FbRestoreFlags.Replace; objFbRestore.Verbose = true; objFbRestore.Start(); while((lineOutput = objFbRestore.GetNextLine()) != null) { // Console.WriteLine(lineOutput); } objFbRestore.Close(); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.WriteLine("Finished!!"); Console.ReadLine(); -- Best regards Carlos Guzmán Álvarez Vigo-Spain --------------------------------- BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 |