SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Hi,
We have a customer who is using our EBO-OPC Client (EWS Server). In SmartConnector, under EWS Server, there is a branch called "Notifications" with 25,770 items. See below.
Can you please explain what is the meaning of this branch and why there are so many items in it?
On our server we don't see this branch.
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
These are there due to Subscriptions from EBO asking for updated values.
However! These should be being cleaned up by your Update Processor every run so they don't eventually cause the database to become slow.
If you are using the EwsItemManager in the SmartConnector.Utilities library you can call:
EwsItemManager.DeleteSubscriptionNotifications();
If you are using the DataAdapter directly, you would need to implement it yourself. I have pasted the code from SmartConnector utilities incase you need it.
var dataAdapter = DataAdapter;
try
{
Logger.LogTrace("EwsItemManager", $"DeleteSubscriptionNotifications");
dataAdapter.AutoCommit = false;
if (subscriptions == null)
{
subscriptions = dataAdapter.Subscriptions.ToList();
}
var ewsSubscriptions = subscriptions as IList<EwsSubscription> ?? subscriptions.ToList();
foreach (var subscription in ewsSubscriptions)
{
dataAdapter.DeleteNotifications(subscription);
}
if (ewsSubscriptions.Count > 0)
{
dataAdapter.DeleteSubscription(ewsSubscriptions
.Where(a => a.Status != EwsSubscriptionStatusEnum.Active).ToList());
}
dataAdapter.CommitChanges();
dataAdapter.AutoCommit = true;
}
catch (SqlException ex)
{
// It is possible that there is already too many entries in the tables to delete without timing out. In that case, you need to log into SQL Management Studio and Truncate the EwsNotificationItems, and EwsSubscriptionItems tables manually.
}
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
Thank you for your answer. Few questions:
1. Can these notifications be avoided/disabled? I had a demo today with a potential customer from Poland. The customer was concerned that with a large number of OPC items (20,000 to 30,000) these notifications will consume space, memory and may slow down the EWS server and the EBO.
2. You wrote "These notifications should be cleaned up by your Update Processor every run". Note that our update processor's Runs On Schedule is False . How often we should do the cleanup? Will this affect the performance?
3. Why I see these notification events on the customer's SmartConnector EWS and not on my SmartConnector EWS?
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
These are there due to Subscriptions from EBO asking for updated values.
However! These should be being cleaned up by your Update Processor every run so they don't eventually cause the database to become slow.
If you are using the EwsItemManager in the SmartConnector.Utilities library you can call:
EwsItemManager.DeleteSubscriptionNotifications();
If you are using the DataAdapter directly, you would need to implement it yourself. I have pasted the code from SmartConnector utilities incase you need it.
var dataAdapter = DataAdapter;
try
{
Logger.LogTrace("EwsItemManager", $"DeleteSubscriptionNotifications");
dataAdapter.AutoCommit = false;
if (subscriptions == null)
{
subscriptions = dataAdapter.Subscriptions.ToList();
}
var ewsSubscriptions = subscriptions as IList<EwsSubscription> ?? subscriptions.ToList();
foreach (var subscription in ewsSubscriptions)
{
dataAdapter.DeleteNotifications(subscription);
}
if (ewsSubscriptions.Count > 0)
{
dataAdapter.DeleteSubscription(ewsSubscriptions
.Where(a => a.Status != EwsSubscriptionStatusEnum.Active).ToList());
}
dataAdapter.CommitChanges();
dataAdapter.AutoCommit = true;
}
catch (SqlException ex)
{
// It is possible that there is already too many entries in the tables to delete without timing out. In that case, you need to log into SQL Management Studio and Truncate the EwsNotificationItems, and EwsSubscriptionItems tables manually.
}
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
Thank you for your answer. Few questions:
1. Can these notifications be avoided/disabled? I had a demo today with a potential customer from Poland. The customer was concerned that with a large number of OPC items (20,000 to 30,000) these notifications will consume space, memory and may slow down the EWS server and the EBO.
2. You wrote "These notifications should be cleaned up by your Update Processor every run". Note that our update processor's Runs On Schedule is False . How often we should do the cleanup? Will this affect the performance?
3. Why I see these notification events on the customer's SmartConnector EWS and not on my SmartConnector EWS?
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
1. No, these are required for EWS Value Updates. If EBO is connected to your EWS server, these will be created.
2. If it is not runs on a schedule, then I assume your processor has some sort of loop to keep making sure the values are up to date. You should hook it into there somewhere. The alternative approach, is that with the Smart Connector.Utilities library, there is a utility processor that you can configure to run on a loop that will clean these up in your EWS Server for you, so you don't need to modify your code.
3. Do you have EBO pointing at your EWS server?
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
Thank you for your answers.
3. Yes. Now I see it. So if I have 20,000 points/values, should I see 20,000 notification items in the EWS?
What is the value of showing this information in the EWS tab in SmartConnector web interface? I mean, if it will be cleaned by the processor in a loop.
Thanks.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
If you are subscribing to 20,000 points in your EWS server, from EBO then I would expect that you would have 20,000, and if you clean up the notifications as you should, you shouldn't really ever go over this number.
As long as you are not building up Notification items in your database, you will be fine with 20,000.
As far as to why we show this information in the EWS Server. An EWS Server does not NEED to be attached to a processor, the web interface is for the Smart Connector EWS Server as a whole, not related to a specific extension.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Michael, did you end up implementing the EwsItemManager.DeleteSubscriptionNotifications() functions in your OPC SmartConnector? We are using it on one of our projects and we are getting the issue described here.
Steve
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.