Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.
Already have an account? Login
You can subscribe to this forum after you log in or create your free account..
Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.
Already have an account? Login
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?
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
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
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.
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
Hi Armend,
This seemed to work:
ewsItemManager.DataAdapter.CreateDatabaseContext();
Thanks for your help.
Steve
User | Count |
---|---|
164 | |
34 | |
33 | |
19 | |
14 | |
11 |
Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.