Self Hosted Service Auto Start.  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Self Hosted Service Auto Start.  Topic is solved

Postby SBarnes » Fri Jun 23, 2017 7:51 pm

Hi All,

trying to get the self hosted service to auto start can sometimes not work, even if you set it to delayed.

The error more than likely will be shown by something like this in the event log.

Service cannot be started. System.Data.SqlClient.SqlException (0x80131904): Cannot open database "JiwaDemo7181" requested by the login. The login failed.
Login failed for user 'JiwaLogin'.
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectio...


and is because SQL Server has not finished starting up before the API does.

The following command will fix the problem by creating a dependency on SQL Server for the API service.

Code: Select all
sc config JiwaAPISelfHostedService.exe depend= MSSQLSERVER
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Self Hosted Service Auto Start.

Postby Mike.Sheen » Fri Jun 23, 2017 8:20 pm

Thanks for this information - not sure what we can do about that, as we've seen people already using the REST API with LocalDB - so adding a dependency service might not suit all use cases.

The workaround you've provided will be added to our documentation - thanks again!
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Self Hosted Service Auto Start.

Postby SBarnes » Sat Jun 24, 2017 12:31 am

Hi Mike,

My only other suggestion which would be more of a nicety more than answer would be if the service had the ability to have its own max retries to login and then send an email somehow to let you know it failed which would be good for LocalDB as well I suppose, which could have benefit for use by customers as well??

By the way the same trick should work for the Plugin Scheduler as well.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Self Hosted Service Auto Start.

Postby Mike.Sheen » Wed Jul 05, 2017 2:28 pm

Thanks - logged as DEV-6059
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757


Return to REST API

Who is online

Users browsing this forum: No registered users and 4 guests

cron