NetTalk Central

Author Topic: Users opening multiple tabs - Issue with memory file and, I think, threads  (Read 5315 times)

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
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?
Cheers,

Stu Andrews

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
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.


Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Hey Kevin,

Yeah, did something like that. It's very strange. The record is absolutely there (debugview'd, checking values etc etc).
Cheers,

Stu Andrews

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email

Hi Stu

Is the memory table threaded?


Johann

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
>> 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



Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email

Hi Stu

Is the memory table threaded?


Johann

Hey Johann,

Yup, is threaded (mentioned it in the initial post).
Cheers,

Stu Andrews

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
>> 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!
« Last Edit: August 14, 2014, 10:04:26 PM by Stu »
Cheers,

Stu Andrews