Subject Re: [Firebird-Java] Re: Another backup error
Author Roman Rokytskyy
> Yes, both of my programs have created an instance of FBBackupManager.
> I would be happy to create an instance only when I'm doing a backup,
> but found no explicit way to close the FBBackupManager.

It is automatically closed after finishing backup. There is one issue with
Services API. It should be considered as a job that you start on the server
and simply redirect the output to your client application. So it really does
not matter whether you close your application or not. If I remember
correctly, API provides means to disconnect, then to reconnect, discover
running jobs, attach to their output and so on.

> When does FBBackupManager connect to the db?
> I'd guess during FBBackupManager.backup(), because the username,
> database and passwords get set separatly. Does the backupmanager close
> the connection, when it finishes backing up?

It should, if not - then it's a bug. The code is simple:

IscSvcHandle svcHandle = attachServiceManager(gds);
try {
gds.iscServiceStart(svcHandle, srb);
queueService(gds, svcHandle);
} finally {
detachServiceManager(gds, svcHandle);
}

The task is specified in srb - ServiceRequestBuffer, which tells the server
what to execute (backup, restore, paths to database, etc). In theory one can
skip the queueService operation, though I did not check how to reconnect
later.

> Then the other backupmanager shouldn't bother it,

If backup is finished - it should work correctly.

> or maybe running in the same jvm causes the problem? (both are run from
> netbeans).

Nope, should not depend on runtime environment.

> I'll do some tests maybe tomorrow, but in the long run I want to do
> backups with multiple clients (from different computers) connected to
> the same database.

Thanks! If you happen to get a reproducable test case, please send it to me.
I will have a look somewhere in January.

Roman