View Full Version : Ext.Direct not combining requests

28 Oct 2011, 5:43 AM
I have a store with the proxy setup like this:

proxy: {
type: 'direct',
api: {
create : Test.Projects.create,
read : Test.Projects.read,
update : Test.Projects.update,
destroy : Test.Projects.destroy

and the remoting api like this:

Test.app.REMOTING_API = {

However when i do something like:

store.add( {name: 'Added Project from main_store'} );
store.getAt(0).set('name', 'Project 1 updated');

the add and update requests are not sent together but separately, 5s apart?

Any idea what am i missing?

Thank you

28 Oct 2011, 6:24 AM
I think the problem is that i am using Ext.data.Store in combination with a direct proxy.
There is a special class called Ext.data.DirectStore that i think should be used for this store

28 Oct 2011, 6:30 AM
Looked at DirectStore and there is nothing there to suggest that it would combine requests so using DirectStore does not solve the original issue

28 Oct 2011, 7:07 AM
The issue is rooted deep in the code

When you do .sync() on a store, it creates a Ext.data.Batch object to which it adds Ext.data.Operation objects and they are executed in "synchronous" mode.

Ext.data.Operation object have a setting called synchronous to which (in theory) the batch object should look and decide if to wait for the current operation to be executed before running the next one, but this setting is ignored.

In conclusion, to be able to send create/update/delete requests grouped together with Ext.Direct two things need to happen

1) fix Ext.data.Batch to obey "synchronous" setting of a operation
3) have a setting on the (server) store telling it to batch the operation in synchronous/asynchronous mode