Running the plugin scheduler service against multiple databases from the same machine

The Jiwa Plugin Scheduler service can be configured to connect and execute plugin code against multiple databases.

Within each database, multiple plugins can be executed by the same service.

These instructions give you two options for running one service against multiple databases:

  1. Configure the JiwaPluginSchedulerService.exe so that it references two databases. The upside of this option is you only have one folder and one service to manage. The downside is you have saved credentials from different databases in the one config file.

  2. Install multiple instances of the service running on the same machine, such that each instance can be configured to connect to different databases.  The upside of this approach is that there's a distinct delineation between the services and the databases they are configured for.  The downside is, it's harder to install and check service releases on the additional service folders.

 

Option 1: Configure a single service

In File Manager navigate to C:\Program Files (x86)\Jiwa Financials\Jiwa 7.

Find the JiwaPluginSchedulerService.exe.config file and open in Notepad.

Copy the "Database" node in the "JiwaPluginSchedulerService.exe.config" file and set the second node's values to point to a second Jiwa database:

<Settings> <PollInterval>60000</PollInterval> <Databases> <Database> <DatabaseName>JiwaDemo</DatabaseName> <ServerName>localhost</ServerName> <JiwaUsername>Admin</JiwaUsername> <JiwaPassword>password</JiwaPassword> </Database> <Database> <DatabaseName>JiwaDemo2</DatabaseName> <ServerName>localhost</ServerName> <JiwaUsername>Admin</JiwaUsername> <JiwaPassword>password</JiwaPassword> </Database> </Databases> </Settings>

Save the config file and start the service.

Option 2: Install multiple services

Copy the Jiwa folder

Locate the Jiwa 7 folder and copy it, naming it as desired.

Run sc.exe

Open a command prompt and type in the following:

sc.exe create "Jiwa Service 2" binPath= "C:\Program Files (x86)\Jiwa Financials\Service2\JiwaPluginSchedulerService.exe"

Note that the "Jiwa Service 2" is the name of the service, and the binPath is the location of the executable.

Important: Make sure there is a space after the = character.

Edit the configuration file

Locate the JiwaPluginSchedulerService.exe.config in the folder copied in the first step (C:\Program Files (x86)\Jiwa Financials\Service2) and edit the contents to connect to the desired database.

Configure the service

Open service.msc and locate your new service and right-click, choose "Properties" from the context menu and ensure the Start up type and Log On information as as desired.

Start the service

Open service.msc and start the service in the usual fashion.

Removing the service

There may be a need at some point to remove the service - to do this simply open a command prompt and type in the following:

sc.exe delete "Jiwa Service 2"

Then delete the contents of the "C:\Program Files (x86)\Jiwa Financials\Service2\" folder.