On Dec 9, 2011, at 6:19 PM, Chuck Hill wrote:

> 
> On 2011-12-09, at 3:05 PM, Michael Gargano wrote:
> 
>> Hey dev. group,
>> 
>>      As I was working on one of my application pages today I noticed 
>> something that I couldn't explain and was hoping one of you nice folks could 
>> shed some light on it.
>> 
>>      -Setting the stage-
>>      One of the pages I'm working on has an AjaxGrid that is periodically (5 
>> secs.) refreshed from an AjaxUpdateContainer.  When the update container 
>> fires, it calls an action that calls
>>      displayGroup.setQualifier(displayGroup.qualifier()) to refresh the 
>> ERXBatchingDisplayGroup as noted in the JavaDoc and by Chuck in previous 
>> posts.
> 
> Calling displayGroup.fetch() might be a better way.

I will try that.

> 
> 
>>      Now the reason this grid is being updated is because I'm running 
>> processes in the background and the grid shows the status of the processes 
>> (qualified by user).  This way I can see when the task completes.
>>      Easy enough.... It seems to work great.
>> 
>>      -The dilemma-
>>      Now here's what I don't get.  If I log into the application as the same 
>> user from two different machines... When I start a new process on one 
>> machine both of the grids update showing that a new process is running (as 
>> expected),
> 
> OK

  OK indeed!  :)
> 
> 
>> but neither ever update the grid when the process is completed.
> 
> Are you sure the Ajax update is actually happening?  Or is an exception 
> thrown on the server side preventing the update.

   Yes, because I do see the SQL in the logs and it does refresh when a new 
process is created.  I don't see any stack traces.

> 
> 
>> If I reload the page on one machine, it updates the status and then 
>> subsequently the other machine refreshes with the correct status, but I need 
>> to poke it.  I don't understand why it works fine on the individual machines 
>> when I'm logged in only once and acts like this when I have two browsers 
>> refreshing the same data.  The page generates a new EC.  I'm guessing it's 
>> some kind of weird locking issue, but I can't figure out what's locking.  
>> I'm using optimistic locking and on top of that, these are only reads.
> 
> 
> One EOF stack or multiple?  Try turning on SQL logging to see what is going 
> on with the database.

  One EOF stack to the database where this is occurring, multiple in the app 
itself, and in production (not the case here) load balanced app servers.
  From what I can see in the SQL logs... when it works the way I expect it to, 
I see the fetch for the full object.  When the refresh is just hanging out, I 
see two queries.  One that gets the count using the user qualifier and then a 
select on the id's for the batch that I'm currently on.  I don't see the fetch 
for the full object in these cases.  That's what's so confusing.  I can't 
figure out what would be different.  The editing context is getting created at 
the page level (and cached in an ivar), does that get cached per page or per 
thread?  If it's per page could it be because they are actually using the same 
editing context?

> 
> 
> Chuck
> 
> 
> -- 
> Chuck Hill             Senior Consultant / VP Development
> 
> Practical WebObjects - for developers who want to increase their overall 
> knowledge of WebObjects or who are trying to solve specific problems.    
> http://www.global-village.net/products/practical_webobjects
> 
> 
> 
> 
> 
> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to