I am using SQL Anywhere 10.
I have two applications, one of them is a service which gets accessed by other applications, a second one is a normal program.
When launched, either will try to start a database engine with the same options (same name, same database name, using shared memory).
My problem is that either application blocks the other from accessing the database. Whichever application i launch first will work well, but the second will try to start a second instance of the engine and crash.
If i launch the service application normally (from the console), then i can use both applications concurrently.
Of course, it is desirable that the service does actually run as a service in Windows. So the question is, is there a way to start the service so that it does not block my other application.

You could create a SQL Anywhere service (using the dbsvc utility or Sybase Central) that starts automatically, and then create your service so that it depends on the SA service. The second service won't start until the server is up and running, and any other applications that run after that can connect to the service as well. Not only does this eliminate the race conditions with multiple applications trying to spawn servers, but it makes connection time much faster since a connection attempt doesn't need to spawn the server first.