Subject JBuilder X with jaybird 2 Restore database
Author hhugo_11
Hello,

Im trying to restore a database the following way.
I have only one connection to the database.
//-------------------------------------------------------------
dataModule1.getDatabaseFB1().closeConnection();
FBBackupManager fBBackupManager= new FBBackupManager();
fBBackupManager.setRestoreReplace(true);
fBBackupManager.setBackupPath("c:/Projekt/FDB/vid.bak");
fBBackupManager.setDatabase("c:/Projekt/FDB/VIDEO.FDB");
fBBackupManager.setUser("sysdba");
fBBackupManager.setPassword("masterkey");
fBBackupManager.setHost("localhost");

try
{
fBBackupManager.restoreDatabase();
}
catch (SQLException ex1)
{
ex1.printStackTrace();
}
//---------------------------------------------------------------

but this exception is thrown. Can this be something related to JBuilder?
I dont have any other connections to the database.

//-----------------------------------------------------------------
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 190. lock time-out
on wait transaction
object C:\PROJEKT\FDB\VIDEO.FDB is in use
user does not have GRANT privileges for operation
null

at
org.firebirdsql.management.FBServiceManager.executeServicesOperation(FBServiceManager.java:278)
at
org.firebirdsql.management.FBBackupManager.restoreDatabase(FBBackupManager.java:273)
at
org.firebirdsql.management.FBBackupManager.restoreDatabase(FBBackupManager.java:266)
at videoport.RestoreDb.<init>(RestoreDb.java:92)
at videoport.Main.jMenuItemReadBackup_actionPerformed(Main.java:1370)
at
videoport.Main_jMenuItemReadBackup_actionAdapter.actionPerformed(Main.java:2123)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
at org.firebirdsql.gds.GDSException: lock time-out on wait transaction
object C:\PROJEKT\FDB\VIDEO.FDB is in use
user does not have GRANT privileges for operation
null
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2703)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2655)
at
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscServiceStart(AbstractJavaGDSImpl.java:2822)
at
org.firebirdsql.management.FBServiceManager.executeServicesOperation(FBServiceManager.java:272)
at
org.firebirdsql.management.FBBackupManager.restoreDatabase(FBBackupManager.java:273)
at
org.firebirdsql.management.FBBackupManager.restoreDatabase(FBBackupManager.java:266)
at videoport.RestoreDb.<init>(RestoreDb.java:92)
at videoport.Main.jMenuItemReadBackup_actionPerformed(Main.java:1370)
at
videoport.Main_jMenuItemReadBackup_actionAdapter.actionPerformed(Main.java:2123)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


Regards,
hugo