Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Where to create the ewsItemManager

SmartConnector Forum

Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • SmartConnector
  • SmartConnector Forum
  • Where to create the ewsItemManager
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
JeffBowman
Sisko JeffBowman Sisko
164
ardak
ardak Schneider Alumni (Retired)
34
sesa180908_brid
Commander sesa180908_brid Commander
34
mike_meirovitz
Commander mike_meirovitz
21
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to SmartConnector Forum
Solved
SteveGregory
Commander SteveGregory Commander
Commander

Posted: ‎2022-03-24 02:31 PM . Last Modified: ‎2022-03-24 02:31 PM

0 Likes
4
1476
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2022-03-24 02:31 PM

Where to create the ewsItemManager

Hi, I am using the ewsItemManager out of the Utilities library and wondering where is the best place to instantiate this in a long running processor. Currently i have it in my DoUpdates loop where it is being created each time the processor goes through the incoming data and updates the changed values on the EWS server, but I am seeing some degradation of performance over time and wondering if that could be the cause?

Tags (1)
  • Tags:
  • english
Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-03-25 12:21 AM

0 Likes
3
1462
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2022-03-25 12:21 AM

Hello,

 

It depends a bit on how you're using it and what kind of performance degradation you but most things in Smartconnector are designed around short lived processors.

 

You could try 

 

ewsItemManager.DataAdapter.CreateDatabaseContext();

 

to refresh the datacontext of the DataAdapter where it's applicable in your loop.

 

BR

Armend

See Answer In Context

Tags (1)
  • Tags:
  • english
Reply
Replies 4
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-03-25 12:21 AM

0 Likes
3
1463
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2022-03-25 12:21 AM

Hello,

 

It depends a bit on how you're using it and what kind of performance degradation you but most things in Smartconnector are designed around short lived processors.

 

You could try 

 

ewsItemManager.DataAdapter.CreateDatabaseContext();

 

to refresh the datacontext of the DataAdapter where it's applicable in your loop.

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
SteveGregory
Commander SteveGregory Commander
Commander

Posted: ‎2022-03-25 01:21 AM

0 Likes
2
1453
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2022-03-25 01:21 AM

Hi Armend,

 

I am creating an instance of the ewsItemManager in the DoUpdates() method which is periodically called by the long running processor. I am using it to read current ews values and write to them if they need to be updated.

When started, the processor takes about 6 seconds to do all the updates. The DoUpdates() method repeats 10 seonds after if finishes, until the cancellation token is called.

After about 4 hours, the time to update the values goes from 6 seconds to about a minute, and keeps getting longer. As soon as you restart the processor, it goes back to 6 seconds.

If i replace all the instances of ewsItemManager with DataAdaptor, the update time is less than 2 seconds and doesn't increase. I understand the ewsItemManager may have some additional overhead, but I don't understand why it would get slower over time. The only thing i can put it down to is that i am creating a new instance of it, each time i DoUpdates() and something is not getting cleaned up. I tried to do ewsItemManager.Dispose() at the end of each update, but it actually disposes of the dbContext and stops the processor. My SmartConnector is working fine now using the DataAdaptor directly, but curious to know what is happening here, or if i am doing something wrong. 

Tags (1)
  • Tags:
  • english
Reply
ardak
ardak Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: ‎2022-03-25 01:47 AM

0 Likes
1
1449
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2022-03-25 01:47 AM

Without seeing your code it's impossible to say for sure, but probably your datacontext(entity framework) is getting huge when using the EwsItemManager. When using the DataAdapter you're probably (knowingly or inadvertently) refreshing the context. There should not be any overhead when using the EwsItemManger.

 

I suggest you try adding the line I suggested above, or preferably refactoring your processor to run when needed. If you are using a long running processor because you have state in the processor you can use the Cache to save state between runs.

 

BR

Armend

Tags (1)
  • Tags:
  • english
Reply
SteveGregory
Commander SteveGregory Commander
Commander

Posted: ‎2022-04-05 12:03 AM

0 Likes
0
1252
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2022-04-05 12:03 AM

Hi Armend,

 

This seemed to work:

 

ewsItemManager.DataAdapter.CreateDatabaseContext();

 

Thanks for your help.

 

Steve 

Tags (1)
  • Tags:
  • english
Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of