Subject Re: [Firebird-Java] Restore FBBackupManager not working (non localhost only) - localhost works
Author Gabriel Reid
On Fri, Oct 20, 2006 at 07:26:33PM -0000, Ashok122 wrote:
> FBBackupManager fb = new FBBackupManager(GDSType.getType("PURE_JAVA"));
> fb.setUser("sysdba");
> fb.setPort(3050);
> fb.setHost("ComputerNameOnNetwork");
> // fb.setHost(""); also not working // I can ping
> // and ComputerNameOnNetwork
> // fb.setHost("localhost"); works fine.
> fb.setPassword("masterkey");
> fb.setVerbose(false);
> fb.setDatabase(sFDBName);
> fb.setBackupPath(sFBKName);
> fb.setRestorePageSize(4096);
> fb.setRestoreReplace(true);
> try {
> fb.restoreDatabase();
> } catch (SQLException ex) {
> ex.printStackTrace();
> }
> Above does not work. It does not give any error. And it does not
> restore. If I change "ComputerNameOnNetwork" to "localhost" in above
> code, it works (provided file exists at same location as in
> "ComputerNameOnNetwork". BTW the backup file exists on both computers
> at same PATH.

I would suggest that the first thing you try is to turn verbose mode on:

If you do this, I expect that you're going to get output similar to what
you got using the GDS layer directly:
gbak: ERROR: cannot open backup file localhost:c:\backups\FIRSTTEST.fbk
gbak: Exiting before completion due to errors

By the way, that seems to be one of the possible shortcomings of the way the
Service Manager system works; output is simply sent back through the
logger, whether it's good or bad news. The current services implementation
in Jaybird doesn't pay any attention to this output; it's up to the
caller to decide if it's good or bad news.

On the other hand, when I test this here (Firebird 1.5.2 on Linux), I
get a GDS exception if there's a problem reading the backup file on the
other side. Whether this is a difference between Firebird releases or
Firebird on different platforms is a mystery to me.

In any case, to get back to the point: assuming you do get the logging
output that I think you'll get, I'd say that you need to figure out why
there's a problem reading the backup file on the remote machine. Perhaps
you could try running gbak itself remotely to see if you get the same or
different results.

And if my guess about what output you'd get isn't correct, please post
back what you do get.

- Gabriel