DWR

watched map grows in AbstractStoreProvider

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 3.0.RC1
  • Fix Version/s: 3.0.1
  • Component/s: Dojo
  • Description:
    while debugging i noticed that watched map grows ever time dojo DataStore calls the fetch function(). the watcher maps grows as well but i'm not sure what's the cause it of.

Activity

Hide
Deno Vichas added a comment - 22/Apr/09 10:14 PM

First off I've been testing the MapStoreProvider using a (dojo) DataGrid. The problem I see with MapStoreProvider is the way is tracks who is subscribe to the store. This problem starts with the client sending a value for dwrRefBy (is this to keep track of what callback to call on the return?) which is different for each request. So when you sort the grid it fires off the fetch function and a new dwrRefById gets generated. This Id ends up being the listener Id for the StoreChangeListener, by the help of ProxyInterfaceConverter and DefaultJavaScriptObject. Since the Id isn't the same for each page the map of watched / watchers never get cleaned up correct on new subscriptions. Shouldn't the listener be using the scriptSessionId (this the correct name?) to track what page (tab / browser) is asking for a subscription? I tried hacking equals() and hashCode() in DefaultJavascriptObject to only pay attention to the session id but I think this has side effects that I don't understand. I'm I correct in think that the class the ProxyInterfaceConverter uses, DefaultJavascriptObject in this case, need to correctly implement equals() and hashCode() has StoreChangeListener is only an interface? This problem causes a memory leak and to have the same client notified multiple time on a store onChange and onDelete.

Show
Deno Vichas added a comment - 22/Apr/09 10:14 PM First off I've been testing the MapStoreProvider using a (dojo) DataGrid. The problem I see with MapStoreProvider is the way is tracks who is subscribe to the store. This problem starts with the client sending a value for dwrRefBy (is this to keep track of what callback to call on the return?) which is different for each request. So when you sort the grid it fires off the fetch function and a new dwrRefById gets generated. This Id ends up being the listener Id for the StoreChangeListener, by the help of ProxyInterfaceConverter and DefaultJavaScriptObject. Since the Id isn't the same for each page the map of watched / watchers never get cleaned up correct on new subscriptions. Shouldn't the listener be using the scriptSessionId (this the correct name?) to track what page (tab / browser) is asking for a subscription? I tried hacking equals() and hashCode() in DefaultJavascriptObject to only pay attention to the session id but I think this has side effects that I don't understand. I'm I correct in think that the class the ProxyInterfaceConverter uses, DefaultJavascriptObject in this case, need to correctly implement equals() and hashCode() has StoreChangeListener is only an interface? This problem causes a memory leak and to have the same client notified multiple time on a store onChange and onDelete.
Hide
Jose Noheda added a comment - 10/Jul/09 8:18 AM

I have to take a closer look to the problem so it does not send multiple notifications but the current code includes a workaround and onlye processes the first one

Show
Jose Noheda added a comment - 10/Jul/09 8:18 AM I have to take a closer look to the problem so it does not send multiple notifications but the current code includes a workaround and onlye processes the first one

People

Dates

  • Created:
    03/Mar/09 8:42 AM
    Updated:
    23/Dec/10 9:47 PM