I have issues on a server running file watcher plugins for 2 databases. In checking for solutions I found this was fixed here https://service.jiwa.com.au/browse/DEV-3231, however I'm still running into problems.
- Code: Select all
JiwaPluginSchedulerService.exe.config:
<Databases>
<Database>
<DatabaseName>Jiwa1</DatabaseName>
<ServerName>IIT-SQL</ServerName>
<JiwaUsername>***</JiwaUsername>
<JiwaPassword>***</JiwaPassword>
</Database>
<Database>
<DatabaseName>Jiwa2</DatabaseName>
<ServerName>IIT-SQL</ServerName>
<JiwaUsername>***</JiwaUsername>
<JiwaPassword>***</JiwaPassword>
</Database>
</Databases>
The TonerUsage file watcher plugin runs on Jiwa1
The PrintUsage file watcher plugin runs on Jiwa2
With the above config, TonerUsage works correctly (ie. with Jiwa2 also in the config) however PrintUsage fails. If Jiwa1 is removed from the config, the PrintUsage works correctly.
The specific error is "Invalid object name 'Addin_Printers'." which refers to an extra table that I have manually added to Jiwa2. I access Addin_Printers as follows (simplified):
- Code: Select all
var row = Helper.SqlDataRow("SELECT TOP 1 * FROM Addin_Printers");
public static DataRow SqlDataRow(string sql, SqlParameter[] paramList = null)
{
var table = new DataTable();
var database = Manager.Database;
var connection = database.SQLConnection;
try
{
using (var sqlCmd = new SqlCommand(sql, connection, database.SQLTransaction))
{
if (paramList != null) sqlCmd.Parameters.AddRange(paramList);
table.Load(sqlCmd.ExecuteReader());
}
return table.Rows.Count == 0 ? null : table.Rows[0];
}
}
It "feels" as though, with the config as shown above, that this code is accessing Jiwa1 instead of Jiwa2, and not finding Addin_Printers.
Could you advise where I'm going astray?
Cheers,
Neil