From: <meg...@ya...> - 2004-02-03 09:57:21
|
Hello All, I'm having some strange problem while using the Service classes of the Firebird provider. I'm using FbBackup and FbRestore. Here is the code : ------------------------------------------------------------------- try { 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.Start(); 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.Start(); objFbRestore.Close(); } catch(Exception ex) { //LogException(); } finally { /*Delete back up file.*/ System.IO.File.Delete(dbBackFile); } ------------------------------------------------------------------- This piece of code is working fine when I execute my project in Debug mode. But when I make an executable, this code gives error. The error message is (formatted) Message : No message for code 190 found. No message for code 133 found. No message for code 233 found. Source : FirebirdSql.Data.Firebird TargetSite : Void startTask() I couldn't make it, why this error would come. Is FbBackup.Start() asynchronous and there should be an explicit Thread.Sleep() after backup? There shouldn't be any connection active, before backup. Isn't? For this I tried to use FbConfiguration object for a forced shutdown. But that was also of no help. Can u give me any idea, why this could be happen? Thanx, Mahesh. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now |
From:
<car...@te...> - 2004-02-03 13:19:37
|
Hello: > Is FbBackup.Start() asynchronous and there should be an explicit > Thread.Sleep() after backup? No. Maybe it's a problem with the FbRestoreFlags.Replace option i will try to review it later today. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From:
<car...@te...> - 2004-02-06 13:41:45
|
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 |
From: <meg...@ya...> - 2004-02-04 05:30:28
|
Hello Carlos, Thanx for ur prompt reply. I also tried this code before posting my previous mail. But this also gives me the same error. If I execute this code in a simple commandline utility, it doesn't gives me any error. Sample : class FbBackupRestore { public static vois Main(){ // 1. // 2. // 3. Yesterday's posted code, with or without the changes u've added } } But suppose I execute a query at the placeholder 1 in the above code, the error comes. I realise that there may be some connection left open, even when I Dispose() and nullify FbConnection and FbCommand objects. I know that only when the GC executes, will this be freed, but then what else could be done to execute backup/restore. At the placeholder 2 in the above code, I tried this code as well. FbConfiguration objFbConfiguration = new FbConfiguration(); objFbConfiguration.UserName = user; objFbConfiguration.UserPassword = password; objFbConfiguration.Database = dbfile; objFbConfiguration.DatabaseShutdown(FbShutdownMode.Forced,0); Thread.Sleep(2000); objFbConfiguration.DatabaseOnline(); Now the first error number changes from 190 to 31 and the remaining error numbers(i.e. : 130 & 233) remains the same, with the same messages for all of them(i.e. : 'No message found for this error number'). Is anything else required to mount and unmount the database? Waiting for reply. Thanx once a'ain, 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 |
From:
<car...@te...> - 2004-02-04 08:19:19
|
Hello: > But suppose I execute a query at the placeholder 1 in the above code, > the error comes. I realise that there may be some connection left open, > even when I Dispose() and nullify FbConnection and FbCommand objects. I > know that only when the GC executes, will this be freed, but then what > else could be done to execute backup/restore. > At the placeholder 2 in the above code, I tried this code as well. Try using Pooling=False in the connection string, by default the connection pooling is enabled, and connections are not really closed ( using FbConnection.Dipose or FbConnection.Close ). -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: <meg...@ya...> - 2004-02-04 13:38:38
|
Hello: So, the bottom line is that I can't execute FbBackup and FbRestore, before waiting for 10 seconds, irrespective of whether I make a call to FbConfiguration or not. Isn't? Also, even I try to call gbak.exe from my code(I tried to do that as well) after making a query and then nullifying everything, I can't do it, as there can be some connections still alive. In my application, I do pooling=true, but the connection string doesn't changes for a session, or we can say that all the connections to the dbfile have same connection string at any particular point of time. Can u think of some work around I can apply in 1.5? Thanx. Mahesh. > > Then I tried a'ain with pooling as true, but make a Thread.Sleep(6000), >> before using FbConfiguration.DatabaseShutdown(FbShutdownMode.Forced,0) >The problem here is that 1.5 has a single pool for all connections, and >a cleanup thread that runs at every 10 seconds this will work in >different way in 1.6, that will have a single pool for each different > connection string ( and a single clean up thread based on the >connection lifetime specified in the connection string ). >-- > Best regards >Carlos Guzmán Álvarez > Vigo-Spain --------------------------------- BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 |
From:
<car...@te...> - 2004-02-04 15:23:01
|
Hello: > Can u think of some work around I can apply in 1.5? The only valid thing seems to be to force the cleanup of the pool and/or allow to check if there are connections opened in the pool, as seems that this is going to be needed i will try to see it but for 1.6 ;) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
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 |
From:
<car...@te...> - 2004-02-04 11:58:26
|
Hello: > Then I tried a'ain with pooling as true, but make a Thread.Sleep(6000), > before using FbConfiguration.DatabaseShutdown(FbShutdownMode.Forced,0) The problem here is that 1.5 has a single pool for all connections, and a cleanup thread that runs at every 10 seconds this will work in different way in 1.6, that will have a single pool for each different connection string ( and a single clean up thread based on the connection lifetime specified in the connection string ). -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: <meg...@ya...> - 2004-02-05 09:01:49
|
Hello, I couldn't find API to clean up the pool. Can u just point that out? How can I access all the connections in the pool to figure out that they are open? Thanx. Mahesh. >Hello: >> Can u think of some work around I can apply in 1.5? >The only valid thing seems to be to force the cleanup of the pool and/or >allow to check if there are connections opened in the pool, as seems >that this is going to be needed i will try to see it but for 1.6 ;) >-- >Best regards >Carlos Guzmán Álvarez >Vigo-Spain --------------------------------- BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 |
From:
<car...@te...> - 2004-02-05 09:04:19
|
Hello: > I couldn't find API to clean up the pool. Can u just point that out? How > can I access all the connections in the pool to figure out that they are > open? There are no way at this moment, as i tell in my prior eamil i will try to review it for 1.6 version. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: <sca...@ma...> - 2004-02-26 06:53:11
|
MI> I'm having some strange problem while using the Service MI> classes of the Firebird provider. I'm using FbBackup and MI> FbRestore. Here is the code : What Firebird .Net Data provider you using? -- Roman. sca...@ma... |