View Full Version : 2 Store loading the same URL with different params

14 Jul 2009, 1:05 AM
I have 2 stores loading the same URL but with different params one after another.

Only 1 store will be able to load properly. Why is it so???

I understand the request is an AJAX asynchronous call, but it should still be 2 different request, right? So if there is 2 different request, it should be able to load.

14 Jul 2009, 1:07 AM
You'll have to post some code for anyone to be able to help.

Please isolate the code into a small test case and link to an online version or post a small copy/pastable example.

14 Jul 2009, 1:19 AM
var reader = new Ext.data.JsonReader({/* json fields*/});

var store1 = new Ext.data.Store


id : "store1",
reader: reader,
remotesort : false,
autoLoad : false
proxy : new Ext.data.HttpProxy

url: "someUrl.jsp"

var store2 = new Ext.data.Store(); /* similiar to store1*/

var grid1 = new Ext.grid.GridPanel() /* simple grid */;
var grid2 = new Ext.grid.GridPanel() /* similiar to store 2*/;

The code where i reload the store :


14 Jul 2009, 2:49 AM
I could be wrong but isn't the proxy simply connecting once (ie being reused but still only making the single connection?)

14 Jul 2009, 2:52 AM
A concurrency issue on your server?

Loading from a JSP??

JSPs are for building a UI.

Use a servlet. And ensure that multiple threads running that servlet do not stomp on each other's data.

14 Jul 2009, 8:01 AM
Remy :

I thought each store should have their own proxy? Which mean it should be 2 differents request?

Animal :

Hm... maybe it could be concurrency. I will try using a servlet and see how I can work it...

14 Jul 2009, 6:27 PM
Does the store.load() have a timeout value specified?

15 Jul 2009, 4:30 AM
I have the same problem.This is the solution i put in place

var proxy = new Ext.data.HttpProxy({
url: 'servlet URL',
method: 'POST'

var store = new Ext.data.Store({
proxy: proxy,
remoteSort: true,
reader: new Ext.data.JsonReader({
totalProperty: 'results',
}, [
//now the second element a combo who goes on the same servlet to fill the data

var proxyCombo = new Ext.data.HttpProxy({
url: 'servlet URL',
method: 'POST'
var storeCombo = new Ext.data.JsonStore({
proxy: proxyCombo,
//send info to my servlet to fill another JSON object
baseParams : {
forCombo : true,
reader: new Ext.data.JsonReader({
totalProperty: 'results',
}, [
var combo = new Ext.form.ComboBox({
store: storeCombo,
valueField: "CODE_ROLE",
displayField: "LIBELLE",

15 Jul 2009, 5:50 PM
I just figured what was my problem...

My JSP/servlet took a extremely long time (30seconds) to return back the result. So, when the 2 stores made their calls, the 2nd call will alway timeout as the first call already took 30 seconds.

I managed to identify it when i used a Ext.Ajax.request and set the timeout to 60 seconds. It managed to return the result for both calls.