NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Stu on August 13, 2014, 07:10:51 PM

Title: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: Stu on August 13, 2014, 07:10:51 PM
Hey Folks,

So as we know, the human race is a silly bunch of people.

We do stuff like open up more than one tab in a system designed to be just a single window.

Ahem. With that out of the way, here goes. Get some popcorn.

I'm implementing a nice solution for this problem.

BUT.

One of the major pieces of functionality doesn't work.

1. User opens up a record form. A memory file record, let's call the file mem_EntityOpened, is added.
2. For some reason the user has a second tab to my system open. They leave their desk for a while, come back, and start working on the second tab.
3. On the second tab, they go to say the homepage.
4. In Webhandler, when certain pages are loaded, the mem_EntityOpened records for that Session are deleted. Cleared. No more.
5. The user goes back to the first tab, sees the stuff they were working on, and clicks on the SAVE button.
6. But in between this time, other users have come and gone in that page, changing stuff. The page for this user has the very early info, and will save over the top of any other changes made in between times.
7. My solution code checks for the entity record in mem_EntityOpened, AND IF IT DOESN'T EXIST (because they were working away on tab 2), doesn't let them save the page.

Now the problem is .. And I _think_ this is because of threads (but am not 100%, a little confused) .. That the check in the form on Save doesn't recognise that the records of the memory file have been deleted.

That is. They have definitely been deleted when the user was working away in tab 2. I even created a browse of the memory form, with delete functionality, and open it up in a second tab and delete the record there. It's GONE.

But in the form, in tab 1, when the user clicks on the Save button .. It still has the record in the memory file. I do a set / next and it is there. It shouldn't be. I can't really understand why it's still there (because the whole point of using a memory file in this situation is so I don't have to use a global queue). But it is.

Any thoughts?
Title: Re: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: kevin plummer on August 13, 2014, 07:46:17 PM
Hi Stu,

I don't work a lot with memory tables so this is just my theory...

The records are loaded into the session Q when the form opens and retrieved in the save record embed. To test the theory stick a button on your form to see if the record exists after you deleted it and prior to clicking your save button.

Title: Re: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: Stu on August 13, 2014, 07:55:24 PM
Hey Kevin,

Yeah, did something like that. It's very strange. The record is absolutely there (debugview'd, checking values etc etc).
Title: Re: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: JohanR on August 13, 2014, 10:45:45 PM

Hi Stu

Is the memory table threaded?


Johann
Title: Re: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: Bruce on August 14, 2014, 12:22:51 AM
>> We do stuff like open up more than one tab in a system designed to be just a single window.

From the release notes;
8.22 - 31 July 2014  
Add: New setting on Performance tab: Multi-Tab support. For a discussion on Multi-Tab support see
http://www.capesoft.com/docs/NetTalk8/NetTalkWebBasic.htm#MultiTab.

you might also want to watch User Group Webinar number 29
http://www.capesoft.com/accessories/NetTalkUserGroup.htm

Cheers
Bruce


Title: Re: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: Stu on August 14, 2014, 10:00:12 PM

Hi Stu

Is the memory table threaded?


Johann

Hey Johann,

Yup, is threaded (mentioned it in the initial post).
Title: Re: Users opening multiple tabs - Issue with memory file and, I think, threads
Post by: Stu on August 14, 2014, 10:01:10 PM
>> We do stuff like open up more than one tab in a system designed to be just a single window.

From the release notes;
8.22 - 31 July 2014  
Add: New setting on Performance tab: Multi-Tab support. For a discussion on Multi-Tab support see
http://www.capesoft.com/docs/NetTalk8/NetTalkWebBasic.htm#MultiTab.

you might also want to watch User Group Webinar number 29
http://www.capesoft.com/accessories/NetTalkUserGroup.htm

Cheers
Bruce


Thanks Bruce!