IE7 having trouble handling large responses / Timing out

View: New views
7 Messages — Rating Filter:   Alert me  

IE7 having trouble handling large responses / Timing out

by Wood Tah-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.

Re: IE7 having trouble handling large responses / Timing out

by Lance Java :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

So... is the problem that the result set is too large or that it takes too long to respond?
 
Here's some tips
 
1. Result set too large
Solution1: Batch the call (client passes record start and record end).
Solution 2: Store the large result on a remote object with "script" scope. Iterate over the remote object after the initial invocation to get the result in batches.
 
2. Takes too long to respond
Solution3: Call has void return type, use reverse ajax to send the result to the client
Solution4: Spawn a thread to do the work, if worker returns within some timeout return the response, if not use solution3
 
 
I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.


RE: IE7 having trouble handling large responses / Timing out

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First, I think you should check if it is IE7's "32767 instructions limit" bug
that is hitting you. Try to return a smaller data set.
 
In either case I think you should upgrade to DWR 2.0.5.
 
Best regards
Mike Wilson


From: tomhiebler@... [mailto:tomhiebler@...] On Behalf Of Wood Tah
Sent: den 12 oktober 2009 14:45
To: DWR Users Group
Subject: [dwr-user] IE7 having trouble handling large responses / Timing out

I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.

Re: IE7 having trouble handling large responses / Timing out

by Tom Hiebler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This has only been seen on IE7 (IE6 and FF do not have the problems).  I can't say what the problem really is yet, but it may be a combination of the 2 problems.  When the items are returned from the remote object, when would the browser think of having the response returned?  Would it be after the items are converted in engine.js, or once the response gets to the javascript code?  We have trying to determine if it is the problem in IE of calling eval() for too many objects, or if it really is just taking too long for the response to return from the server.

Our application does searches, and then results are returned.  Results are normally returned in batches of about 250 items, but occasionally things may return  in a batch of up to 500 results.  We were already starting to add in code changes to try and limit the size to 100 or 150 results returned at a time, but if there was something else that could be done, it would be preferable.  We can also load a previous search result, which could have up to 1000 results.  We know that this has to be re-worked to probably do a client side poll similar to what it done during the search.

I am not sure I know exactly what you mean with Solution #2, can you elaborate on that some more?  Any generic  code examples?  You can only set the creator to be script-scoped, right?  If I set MyRemoteObject to have script scope, and the method call I was using was: MyRemoteObject.getSearchResults(), and this returned a SearchResponse object which contained a list of results, what would I need to do?



On Mon, Oct 12, 2009 at 9:05 AM, Lance Java <lance.java@...> wrote:
So... is the problem that the result set is too large or that it takes too long to respond?
 
Here's some tips
 
1. Result set too large
Solution1: Batch the call (client passes record start and record end).
Solution 2: Store the large result on a remote object with "script" scope. Iterate over the remote object after the initial invocation to get the result in batches.
 
2. Takes too long to respond
Solution3: Call has void return type, use reverse ajax to send the result to the client
Solution4: Spawn a thread to do the work, if worker returns within some timeout return the response, if not use solution3
 
 
I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.



Re: IE7 having trouble handling large responses / Timing out

by Lance Java :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here's a simple example of #2... you can obviously be a bit smarter and clean up the results once they've been read.
 
dwr.xml
 
<allow>
  <create creator="new" javascript="SearchScriptBean" scope="script">
    <param name="class" value="foo.bar.SearchScriptBean"/>
  </create>
  ...
</allow>

 
public class SearchScriptBean {
   private List<Result> results;
   private SearchService searchService = ...;
 
   public synchronized int initiateSearch(final SearchCriteria criteria) {
      results = searchService.search(criteria);
      return results.size();
   }
 
   public synchronized List<Result> getResults(int from, int to) {
      return results.sublist(from, to);
   }
}
 
 
2009/10/12 Tom Hiebler <tomhiebler@...>
This has only been seen on IE7 (IE6 and FF do not have the problems).  I can't say what the problem really is yet, but it may be a combination of the 2 problems.  When the items are returned from the remote object, when would the browser think of having the response returned?  Would it be after the items are converted in engine.js, or once the response gets to the javascript code?  We have trying to determine if it is the problem in IE of calling eval() for too many objects, or if it really is just taking too long for the response to return from the server.

Our application does searches, and then results are returned.  Results are normally returned in batches of about 250 items, but occasionally things may return  in a batch of up to 500 results.  We were already starting to add in code changes to try and limit the size to 100 or 150 results returned at a time, but if there was something else that could be done, it would be preferable.  We can also load a previous search result, which could have up to 1000 results.  We know that this has to be re-worked to probably do a client side poll similar to what it done during the search.

I am not sure I know exactly what you mean with Solution #2, can you elaborate on that some more?  Any generic  code examples?  You can only set the creator to be script-scoped, right?  If I set MyRemoteObject to have script scope, and the method call I was using was: MyRemoteObject.getSearchResults(), and this returned a SearchResponse object which contained a list of results, what would I need to do?




On Mon, Oct 12, 2009 at 9:05 AM, Lance Java <lance.java@...> wrote:
So... is the problem that the result set is too large or that it takes too long to respond?
 
Here's some tips
 
1. Result set too large
Solution1: Batch the call (client passes record start and record end).
Solution 2: Store the large result on a remote object with "script" scope. Iterate over the remote object after the initial invocation to get the result in batches.
 
2. Takes too long to respond
Solution3: Call has void return type, use reverse ajax to send the result to the client
Solution4: Spawn a thread to do the work, if worker returns within some timeout return the response, if not use solution3
 
 
I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.




RE: IE7 having trouble handling large responses / Timing out

by mikewse :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> This has only been seen on IE7 (IE6 and FF do not have the problems).
 
Again, this suggests that it is the IE7 "max 32767 instructions" [per eval] that is plaguing you.
Check this by first identifying a search that doesn't work in IE7, and then f ex run the same request in Firefox and examine the response using Firebug's Net tab making a rough count of the number of instructions. In the response you can see that not only does top-level return objects add to the total instruction list, but so do child objects and properties. Thus, if your objects are complex, it will take fewer objects to reach the 32767 limit.
 
Best regards
Mike Wilson


From: Tom Hiebler [mailto:tomhiebler@...]
Sent: den 12 oktober 2009 19:05
To: users@...
Subject: Re: [dwr-user] IE7 having trouble handling large responses / Timing out

This has only been seen on IE7 (IE6 and FF do not have the problems).  I can't say what the problem really is yet, but it may be a combination of the 2 problems.  When the items are returned from the remote object, when would the browser think of having the response returned?  Would it be after the items are converted in engine.js, or once the response gets to the javascript code?  We have trying to determine if it is the problem in IE of calling eval() for too many objects, or if it really is just taking too long for the response to return from the server.

Our application does searches, and then results are returned.  Results are normally returned in batches of about 250 items, but occasionally things may return  in a batch of up to 500 results.  We were already starting to add in code changes to try and limit the size to 100 or 150 results returned at a time, but if there was something else that could be done, it would be preferable.  We can also load a previous search result, which could have up to 1000 results.  We know that this has to be re-worked to probably do a client side poll similar to what it done during the search.

I am not sure I know exactly what you mean with Solution #2, can you elaborate on that some more?  Any generic  code examples?  You can only set the creator to be script-scoped, right?  If I set MyRemoteObject to have script scope, and the method call I was using was: MyRemoteObject.getSearchResults(), and this returned a SearchResponse object which contained a list of results, what would I need to do?



On Mon, Oct 12, 2009 at 9:05 AM, Lance Java <lance.java@...> wrote:
So... is the problem that the result set is too large or that it takes too long to respond?
 
Here's some tips
 
1. Result set too large
Solution1: Batch the call (client passes record start and record end).
Solution 2: Store the large result on a remote object with "script" scope. Iterate over the remote object after the initial invocation to get the result in batches.
 
2. Takes too long to respond
Solution3: Call has void return type, use reverse ajax to send the result to the client
Solution4: Spawn a thread to do the work, if worker returns within some timeout return the response, if not use solution3
 
 
I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.



Re: IE7 having trouble handling large responses / Timing out

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sounds like Mike is right.  We have an open issue for this:

This has been encountered quite a few times so I think we should fix it but at the same time I think that returning that much data to the client in one shot is probably not a good idea.  Until we do fix it I recommend proceeding with sending smaller results to the client.



On Mon, Oct 12, 2009 at 11:43 AM, Mike Wilson <mikewse@...> wrote:
> This has only been seen on IE7 (IE6 and FF do not have the problems).
 
Again, this suggests that it is the IE7 "max 32767 instructions" [per eval] that is plaguing you.
Check this by first identifying a search that doesn't work in IE7, and then f ex run the same request in Firefox and examine the response using Firebug's Net tab making a rough count of the number of instructions. In the response you can see that not only does top-level return objects add to the total instruction list, but so do child objects and properties. Thus, if your objects are complex, it will take fewer objects to reach the 32767 limit.
 
Best regards
Mike Wilson


From: Tom Hiebler [mailto:tomhiebler@...]
Sent: den 12 oktober 2009 19:05
To: users@...
Subject: Re: [dwr-user] IE7 having trouble handling large responses / Timing out

This has only been seen on IE7 (IE6 and FF do not have the problems).  I can't say what the problem really is yet, but it may be a combination of the 2 problems.  When the items are returned from the remote object, when would the browser think of having the response returned?  Would it be after the items are converted in engine.js, or once the response gets to the javascript code?  We have trying to determine if it is the problem in IE of calling eval() for too many objects, or if it really is just taking too long for the response to return from the server.

Our application does searches, and then results are returned.  Results are normally returned in batches of about 250 items, but occasionally things may return  in a batch of up to 500 results.  We were already starting to add in code changes to try and limit the size to 100 or 150 results returned at a time, but if there was something else that could be done, it would be preferable.  We can also load a previous search result, which could have up to 1000 results.  We know that this has to be re-worked to probably do a client side poll similar to what it done during the search.

I am not sure I know exactly what you mean with Solution #2, can you elaborate on that some more?  Any generic  code examples?  You can only set the creator to be script-scoped, right?  If I set MyRemoteObject to have script scope, and the method call I was using was: MyRemoteObject.getSearchResults(), and this returned a SearchResponse object which contained a list of results, what would I need to do?



On Mon, Oct 12, 2009 at 9:05 AM, Lance Java <lance.java@...> wrote:
So... is the problem that the result set is too large or that it takes too long to respond?
 
Here's some tips
 
1. Result set too large
Solution1: Batch the call (client passes record start and record end).
Solution 2: Store the large result on a remote object with "script" scope. Iterate over the remote object after the initial invocation to get the result in batches.
 
2. Takes too long to respond
Solution3: Call has void return type, use reverse ajax to send the result to the client
Solution4: Spawn a thread to do the work, if worker returns within some timeout return the response, if not use solution3
 
 
I know that this is not a DWR problem, but I figured someone might have come across this in the past and had suggestions for getting around the problem, or maybe there was even something built in to DWR that could help.

It appears that IE7 is having trouble returning large responses from the server to the browser, and it seems like the  response never comes back.  The objects that are being marshalled are somewhat complex, and have several large collection of objects.  Doing some more investigation, it seems like the default timeout for a response from the server in IE7/IE8 is 30 seconds, changed from a setting of 60 seconds in IE6.  There is a registry key that will allow us to increase the timeout, but we can't change this on our customer's machines.  (Timeout settings and registry key information found here:  http://support.microsoft.com/kb/181050).  Unlike what is mentioned in the article, no error message is ever received (maybe this is caught by DWR ?).

The timeout setting that can be passed w/ the call metadata object has no effect on the browser, correct?  (Unable to test this at the time b/c our system is down for maintenance).  The only solution that we can think of that may get us by this problem is to try and find the magic number of results that can be returned and handled by IE, and limit the size of results to that (or slightly less), and then implement something that notifies the user that more calls to the server are needed to get all the results, or do this automatically for them.  If this works, great, but this is not the ideal solution, b/c now we are required to do some browser sniffing, and it means more code to maintain.

Has anyone ever come across a similar problem to this?  If so, how did you handle it?  Is there something in the configuration of DWR that can be set that can help things?  We are using v2.0.1, and at least for now, can not upgrade to any other versions in the near future.

Thanks.