-
4 Nov 2011 2:23 AM #1
Cleaning up transaction history
Cleaning up transaction history
I've noticed that Ext.Direct.transactions contains a history of Ext.Direct calls. In the case of the call that I'm using to load a form, this information includes a reference to that form instance. The result is that the memory for the form is never released. Is there a way to clear this history (or specific entries) and properly free up the memory?
Thanks,
Rob
-
4 Nov 2011 7:15 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Is there a reason to keep a history?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
7 Nov 2011 3:30 AM #3
-
7 Nov 2011 6:14 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
8 Nov 2011 5:23 AM #5
My Ext Direct calls are defined like this:
Any time I call one of those functions a new item is added to the Ext.Direct.transactions.items array.Code:Ext.app.EXTDIRECT_API = { "url" : "\/direct\/router", "type" : "remoting", "actions" : { "dbs" : [ { "name" : "getAgents", "len" : 1, "args" : [ ] }, { "name" : "setRating", "len" : 1, "args" : [ ] }, { "name" : "calculateRating", "len" : 0, "args" : [ ] }, { "name" : "getCpus", "len" : 1, "args" : [ ] }, { "name" : "setSettings", "len" : 1, "formHandler" : true, "args" : [ ] }, { "name" : "getSettings", "len" : 0, "args" : [ ] } ] } };
-
8 Nov 2011 5:24 AM #6
Just realised I never mentioned what version I'm on. This is using the new 4.0.7.
-
8 Nov 2011 6:58 AM #7Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
If you look at RemotingProvicer.js source, on like 298 and 318 it executes the removeTransaction method on the Ext.direct.Manager. Set a breakpoint and see if that ever gets to it. I wouldn't set a breakpoint at those lines, I would do at the beginning of the method and follow it. It's the onData method in RemotingProvider
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
9 Nov 2011 4:53 AM #8
The onData() method of RemotingProvider calls Ext.direct.Manager.removeTransaction() on line 298. This in turn calls getTransaction(), which checks for an isTransaction property on the transaction object. Since there isn't one it performs another look-up which fails and returns undefined. If I call Ext.direct.Manager.removeTransaction() using the original value for the transaction object that's passed into removeTransaction then the item appears to be removed as expected.
Where should the isTransaction property come from? It appears to be the condition that causes the failing lookup. I had a look in ext-all-debug-w-comments.js and 'isTransaction' only appears that one time where it's read. I did a search in the API docs for 'isTransaction' and came up empty.
-
15 Nov 2011 12:22 AM #9
Hi,
Is there any more information you can provide?
Thanks,
Rob
-
27 Nov 2011 11:01 PM #10
A hotfix
A hotfix
This fix worked for me:
Code:Ext.direct.Manager.getTransaction = function(transaction){ return transaction.isTransaction || Ext.isObject(transaction) ? transaction : this.transactions.get(transaction); };


Reply With Quote