Skip to content

Running as service

Mark Rotteveel edited this page Jul 19, 2015 · 1 revision

This is post from Firebird-Java group by Carsten Schäfer:

Hi, my app is running as an application with type2-driver in local-mode (configuration as in my last messages). (all is running, besides the exception at startup if fbclient.dll is not in system32-dir) Now i wanted to run my aplication as a windows service (Java Service Launcher: http://www.roeschter.com/index.html). I get the following exception for every datasource.getConnection():

 org.firebirdsql.jdbc.FBSQLException: Resource Exception. unavailable database
 Reason: unavailable database
 at
 org.firebirdsql.pool.FBConnectionPoolDataSource.allocateConnection(FBConnectionPoolDataSource.java:171)
 ...

I need to configure the service to allow interaction with the desktop, but so i cannot start the service with a different user account. Is this a bug in type2 ?

No, this is not a bug, that’s how Firebird works in local mode. Here’s an excerpt from IBPhoenix

Question:

I have a non interactive service running, that collects data via ftp from another computer and INSERTs? this into my database. Now I want to automatically do a backup/restore. I generated a batch file that does what I want. But if I call the batch with ShellExec? gbak reports: gbak: ERROR: unavailable database

Answer:

You should be able to do this if you use the loopback remote access method to access the database. That is: localhost:D:\daten\ppcdata_tr4\ppc.gdb

The local access method uses a virtual window to communicate between client (gbak) and server (ibserver). Thus ibserver and any service that interacts with it must interact with the desktop in order to use this virtual window.

If you use the remote access method, the client doesn’t use this virtual window