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

DataAdapter Deferred Commit

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
  • DataAdapter Deferred Commit
Options
  • Subscribe to RSS Feed
  • 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
Lihov
Lieutenant | EcoXpert Master Lihov Lieutenant | EcoXpert Master
Lieutenant | EcoXpert Master

Posted: ‎2018-02-27 10:27 PM

0 Likes
5
988
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2018-02-27 10:27 PM

DataAdapter Deferred Commit

Hi, All!

I rebuilt my SmartConnetor.OpcClassicalExtension for SmartConnector framework v2.3.113 with using of deferred commit feature in DataAdapter class. I got the following results - for 3000 OPC tags data update period duration in EWS server decreases up to 13 seconds from 105 (detailed info by link -

https://docs.google.com/spreadsheets/d/1Uy16JujwfwZbfahqKgbUoAGWs2hOWAcWFJw44Wf75y4/edit?usp=sharing​ ). It is great but not enough because the increasing of OPC tags number enlarge the EWS server update data duration. And when we have 10000 OPC tags the result is unacceptable. Also the CPU usage during data update period is 30-40%...

So, my question is how to obtain low values for update data period (<1000ms for 10000 of OPC tags)? May be using CSP classes help me? Described case is a limit for DataAdapter?

Reply
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
JeffBowman
Sisko JeffBowman Sisko
Sisko

Posted: ‎2018-02-28 06:03 AM

2 Likes
3
930
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2018-02-28 06:03 AM

Hi,

Unfortunately at this time, the data adapter isn't as 'Write optimized' as one may like. There are ways around this, but it will add some complexity to your update code, as you will need to rely on the Database context directly, and not the adapter to get the faster speeds.

You will need to add a reference to Mongoose.Service.Data in your processor class, as well as reference Mongoose.Service (from your SmartConnector installed directory in your project).

Here is a simple example about how to mass update points (which should in theory be faster.). But it does not include any validation and it will not update any HistoryItems the ValueItem is attached to, it is only just an example of how to use the DB context. I need to stress, you need to be in incredibly, incredibly careful doing it this way, as it can have unintended consequences, which can get you in a lot of trouble.. Also, while we support issues that may come out of using the DataAdapter, we cannot support issues that come up doing it this way.

private void UpdateExistingValues(List<PointToUpdate> pointsToUpdate)

{

     using (var dbContext = new MongooseDbContext())

     {

          Logger.LogTrace(LogCategory.Processor, this.Name, "Updating Existing Valueitems");

          var ewsServer = dbContext.EwsServers.FirstOrDefault(a => a.Id == _dataAdapter.Server.Id);

          if (ewsServer != null)

          {

               var values = dbContext.EwsValueItems.Where(a => a.EwsServerId == _dataAdapter.Server.Id).ToList();

               foreach (var pointToUpdate in pointsToUpdate)

               {

                    var valueItem = values.FirstOrDefault(a => a.AlternateId == pointToUpdate.Id);

                    if (valueItem != null)

                    {

                         if (valueItem.Value != pointToUpdate.Value.ToString())

                         {

                              valueItem.Value = pointToUpdate.Value.ToString(); // You need to make sure the Ews Value Item type is this point type.. or else it can cause issues later..

                              valueItem.LastModified = DateTime.UtcNow; // You MUST set this, so that EWS subscriptions will pick up the change.

                         }    

                    }    

               }

               dbContext.SaveChanges();

          }

     }

}

In one case, I was actually able to reduce the time it took to do the creation of a lot of points from 24 minutes.. to 9 seconds.

Regards,

-Jeff

See Answer In Context

Reply
Replies 5
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2018-02-28 05:50 AM

1 Like
0
930
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2018-02-28 05:50 AM

EwsClient is used to communicate to any EWS Server.

CspClient is used to communicate to SBO only.

The EwsServerDataAdapter is used manipulate data for a SmartConnector EWS Server.

If the deferred commit in the EwsServerDataAdapter is not sufficient, you could use a direct ODBC connection to the SmartConnector database.  You would be responsible for all validation and data integrity requirements though.  That is why this approach should be used with great caution.  I'm not sure if that would actually help in this situation though but you would be circumventing any EntityFramework (ORM used in SmartConnector) overhead.

That said, I'm not completely clear what all the entries in your spreadsheet represent. A diagram showing the systems involved and protocols used would help.

Reply
JeffBowman
Sisko JeffBowman Sisko
Sisko

Posted: ‎2018-02-28 06:03 AM

2 Likes
3
931
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

‎2018-02-28 06:03 AM

Hi,

Unfortunately at this time, the data adapter isn't as 'Write optimized' as one may like. There are ways around this, but it will add some complexity to your update code, as you will need to rely on the Database context directly, and not the adapter to get the faster speeds.

You will need to add a reference to Mongoose.Service.Data in your processor class, as well as reference Mongoose.Service (from your SmartConnector installed directory in your project).

Here is a simple example about how to mass update points (which should in theory be faster.). But it does not include any validation and it will not update any HistoryItems the ValueItem is attached to, it is only just an example of how to use the DB context. I need to stress, you need to be in incredibly, incredibly careful doing it this way, as it can have unintended consequences, which can get you in a lot of trouble.. Also, while we support issues that may come out of using the DataAdapter, we cannot support issues that come up doing it this way.

private void UpdateExistingValues(List<PointToUpdate> pointsToUpdate)

{

     using (var dbContext = new MongooseDbContext())

     {

          Logger.LogTrace(LogCategory.Processor, this.Name, "Updating Existing Valueitems");

          var ewsServer = dbContext.EwsServers.FirstOrDefault(a => a.Id == _dataAdapter.Server.Id);

          if (ewsServer != null)

          {

               var values = dbContext.EwsValueItems.Where(a => a.EwsServerId == _dataAdapter.Server.Id).ToList();

               foreach (var pointToUpdate in pointsToUpdate)

               {

                    var valueItem = values.FirstOrDefault(a => a.AlternateId == pointToUpdate.Id);

                    if (valueItem != null)

                    {

                         if (valueItem.Value != pointToUpdate.Value.ToString())

                         {

                              valueItem.Value = pointToUpdate.Value.ToString(); // You need to make sure the Ews Value Item type is this point type.. or else it can cause issues later..

                              valueItem.LastModified = DateTime.UtcNow; // You MUST set this, so that EWS subscriptions will pick up the change.

                         }    

                    }    

               }

               dbContext.SaveChanges();

          }

     }

}

In one case, I was actually able to reduce the time it took to do the creation of a lot of points from 24 minutes.. to 9 seconds.

Regards,

-Jeff

Reply
Lihov
Lieutenant | EcoXpert Master Lihov Lieutenant | EcoXpert Master
Lieutenant | EcoXpert Master

Posted: ‎2018-02-28 06:47 PM

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

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

‎2018-02-28 06:47 PM

Thanks a lot for responses. I'll try it.

Reply
JeffBowman
Sisko JeffBowman Sisko
Sisko

Posted: ‎2018-03-12 06:57 AM

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

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

‎2018-03-12 06:57 AM

Any luck with this?

Regards,

-Jeff

Reply
Lihov
Lieutenant | EcoXpert Master Lihov Lieutenant | EcoXpert Master
Lieutenant | EcoXpert Master

Posted: ‎2018-03-14 08:08 PM

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

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

‎2018-03-14 08:08 PM

Hi, Jeff.

I had an urgent task, and I could not check it immediately. Yesterday I did it.

The duration for update operation is 1500-2000 ms. I think it is acceptable results.

Thanks a lot for your help!

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