Issue Details (XML | Word | Printable)

Key: JDBC-600
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Mark Rotteveel
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JDBC Driver

Shutdown immediately followed by validate results in exception

Created: 25/Nov/19 03:28 PM   Updated: 25/Jul/20 11:15 AM
Component/s: Services API
Affects Version/s: Jaybird 3.0.7
Fix Version/s: None

 Description  « Hide
As reported on Firebird-support (2019-11-25, thread "Why I cannot use firebird services to validate a remote database"):

I was trying to shutdown a Firebird 2.1 using the Jaybird 3.x to validate the database.

I wasn't abble to shutdown it like "gfix -shut multi -force 0 remote_server_host:database"

So, when I perform the validate using the jaybird service I got this:

java.sql.SQLException: bad parameters on attach or create database; secondary server attachments cannot validate databases [SQLState:HY000, ISC error code:335544325]
Caused by: org.firebirdsql.jdbc.FBSQLExceptionInfo: bad parameters on attach or create database

But, if I use the gfix command: gfix -shut multi -force 0 remote:database the validation performs!

Workaround/solution is to add a 1 second sleep between shutdown and validate:

The problem was the "time" between perform the SHUTDOWN and the VALIDATION.

I just add a 1 second "sleep" between the shutdown and validate, and it works!

FBMaintenanceManager mgr = ...... ;
mgr.shutdownDatabase(FBMaintenanceManager.SHUTDOWN_FORCE, 0);
Thread.sleep(1000); // holy sleep

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 25/Nov/19 03:30 PM
I'm not sure if this is a Jaybird problem, or just a result of how Firebird handles a shutdown. I'll need to investigate if this is something that Jaybird can fix or not.

Mark Rotteveel added a comment - 22/May/20 10:53 AM
Unfortunately, I have not been able to reproduce this problem. My guess is that the shutdown takes some time to complete, even after the shutdown returns, or possibly it is advisable to specify a non-zero timeout (although AFAIK, that shouldn't matter with SHUTDOWN_FORCE).

If you can consistently reproduce it, it would be helpful for me to get more information:
* What is the exact Firebird version?
* What platform (Windows, Linux, ...)?
* Do you use SuperServer, SuperClassic or Classic?
* How many connections are attached to the database when issuing the shutdown, and what are they doing?

Mark Rotteveel added a comment - 22/May/20 10:55 AM
Deferring to later version

Mark Rotteveel added a comment - 25/Jul/20 11:15 AM
As I cannot reproduce the problem, I can't fix it.