Refreshing Data Connection taking very long time. - InfoPath Dev
in

InfoPath Dev

Refreshing Data Connection taking very long time.

Last post 06-16-2010 04:08 AM by mrsafe. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-08-2010 07:08 AM

    Refreshing Data Connection taking very long time.

    Hi Guys,

    I have a vlarge browser based form that connects via code to several sharepoint lists. The form is divided into sections each section being list driven and subsequntly driven by a dataconnection. I have one data connection which admittedly is the largest that takes ten minutes to complete using a browser located on a web front end and does not complete at all on a remote browser due to time out.

    Details:

    I have a 'Cancel' button hooked up to an event handler in VSTA. The code calls a method containing the following:

    SharepointListQueryConnection spConnection = (SharepointListQueryConnection)this.DataConnections[list];
    spConnection.Execute();

    If I pass any of the smaller DC titles into this function the performance is immediate indicating an issue with the list, list columns or datatypes on the larger list or form fields. Could some one advise me of a sensible place to start looking for issues?

  • 06-08-2010 10:15 AM In reply to

    Re: Refreshing Data Connection taking very long time.

     why don't you use object model to connect to Sharepoint lists, that will greatly reduce the loading time

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 06-10-2010 02:46 AM In reply to

    Re: Refreshing Data Connection taking very long time.

    I see your point, and I do use the object model for updating, adding and deleting the list items. I use the DCs for pulling the data when the form opens and when the view changes back to a non editable state. I did this because it was fast. It seems that if I do your suggestion I am not really utilising infopath and I may have well written it as a ASP.Net app. I am trying to promote the merits of IP by building a complete application using it as opposed to your standard expense form etc. I realise that what I am doing is quite ambitious but I am trying to promote by in. 

    Let me explain this in more detail:

    The form has 50 elements and a dynamic set 0-n elements in a repeating list. the 49 static elements are all filtered by a primary key shared over 5 SPlists. The primary key is in the form of a drop down on the form representing a software title. The user selects a software title and the rest of the form loads up the remiaing 49 elements of info. So every element is filtered based on the the PK value :

    @Software_loc[@Sofwatre_Name = SoftwareTitle] for example.

    As you can see, all of these filters rely on a DC to function. So I have my 50 element in big non editable view for lookup. If the user wish to edit any element, an edit button is clicked and the form switches view to reduced editable subset such as "Edit Software Details" others being "Edit License Details" "Edit Software contacts" and on...... At this point I can cancel, save or delete. If I save, the SPListItem for that section is updated. The data connection refeshed and the view is switched back to the main one. If I cancel I call the refesh data connection and switch view, the reason being that if I have edited before canceling, the changes I made will be present when I switch views.

    As you can probably tell I am pretty committed to the whole refreshing DCs thing and the issue is that this does not occurr in preview mode. And none of the other DCs are causing an issue.  The DC causing the issue is looking up 25 columns in a SPList. Other closest is 16 with no issues. I do have date columns that were causing an issue on look up times throw the infamous script time out error in I.E, I have since fixed this and lookup is now around 1 second over 500 list items. 

    When I do fire the Execute comment on the DC the W3WP process goes bananas and Stays at 100% CPU until the post back is completed. This is most perplexing as I have no control beyond calling the execute method on that object.

    I see nothing in the ULS logs ecpect when the command was issued and nothing in the event viewer. I have seen posts mentioned changing the IPFS dll for a pre SP1 version. Is this what I should be trying?

     

  • 06-10-2010 10:58 PM In reply to

    Re: Refreshing Data Connection taking very long time.

     the only thing wrong with data connections is that they tend to fetch all the data from the data base in case of sharepoint.. so that is what is giving you form nightmares.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 06-11-2010 01:05 AM In reply to

    Re: Refreshing Data Connection taking very long time.

    Hi Qazi, thanks for the continued discussion. 

    This is what I'm not getting. When the form is opened, that same data connection is fired, the form takes 10 seconds maximum to load and as you say, I am pulling everything at that point, so by my reckoning, pulling it again should take the same amount of time, if not, less. However, if I fire the data connection manually using a button hooked up to the code above, according to fiddler, we're talking 240 seconds, and is after I have stripped it back to only get 1 of the 25 columns. This is making think issue rather data volume. Does that make sense to you?

    Do you know what happens when the code is fired?
    I'm presuming its a CAML query to the list webservice?
    If that's the case, does the XML returned hang around memory?

    If I'm right then maybe there's an issue with the disposal of the previous XML returned from the first call via the dataconnection?

    Just in case in the very unlikely event that I am right, is it possible to NULL the DC before fireing it again?

  • 06-11-2010 07:20 AM In reply to

    Re: Refreshing Data Connection taking very long time.

     if you are fetching the data at load time why do you need to fetch it again,

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 06-11-2010 07:59 AM In reply to

    Re: Refreshing Data Connection taking very long time.

    Because its changed or may have changed.

  • 06-16-2010 04:08 AM In reply to

    Re: Refreshing Data Connection taking very long time.

    So clearly there is an issue either with infopath or my form as there does not seem to be any complete dissagreements with my inference.

    So Plan B, switch to CAML queries, so I now call a camel query every time cancel save or delete a form, this works fine, so Now I want to call the CAML query when the form loads and evey time the software title is changed inside the drop down, drop down now driven off of cut down data connection which only pulls in the software title. So I'm now thinking easy, just hook up a changed event to the drop and fire the query populating the rest of the form fields when the a new Software title is selected, WRONG!!!!

    "An error occurred in the form's code. The number of calls to the Changed event for a single update in the data exceeded the maximum limit." 

     So what's happening here?

    I'm guessing that because I've hooked a change event up to the drop down list, the change event is getting fired once for every item loaded into that control from the data connection?

     

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.