NetTalk Central

Author Topic: Handling Threads???  (Read 3469 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Handling Threads???
« on: September 15, 2010, 11:58:54 AM »
Hi,
Trying to get a handle on how to Thread or Not to Thread in Net Talk Application.
I shall give an example to illustrate:

Browse with list of companies is on the screen.
User selects a company and starts entering a transaction ( Transaction ID #1)  - this TransactionID can be stored in the Session Queue and then retrieved to link the OrderedItems to this Transaction.

Suppose that the user does not complete TransactionID #1 because the phone rings and they get interrupted.
Now they go to the main Company Browse and they start a new transaction (Transaction ID #2) - they start entering OrderItems for this TransactionID #2 and Transaction ID#2 is stored in the Session queue.

Now, how do they handle Transaction #1 which has not yet been completed - Transaction ID #2 information is stored in the Session Queue?

What is the best way to handle this ?
Start Each transaction on a New Thread?  Can you retrieve the SessionQueue values by the thread ID?
Other Ways?
Trying to get my head around how to manage this with Net Talk as the end users do not always complete the task at hand and may jump between tasks.

Thanks for any insight.

Ron Jolda

ccordes

  • Sr. Member
  • ****
  • Posts: 384
    • View Profile
    • Email
Re: Handling Threads???
« Reply #1 on: September 15, 2010, 12:18:55 PM »
What is funny is that as far as the server is concerned, every click is something new and only the session number being passed links them together.
So since they started transaction 2, transaction 1 doesn't exist. That's why things don't get saved until the very last bit when the submit button is clicked.
When they started transaction 2, the session queue regarding transaction fields, got cleared.
Everything makes the page refresh.
Management of the session queue is what makes the whole thing work.
If they allowed their session to time out then anything in that session is also lost.

Real programmers use copy con newapp.exe

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Handling Threads???
« Reply #2 on: September 15, 2010, 05:36:53 PM »
Ron the only alternative I have come up with is as soon as a new record is inserted I save this and change the mode to change mode. I mainly do this so the the parent record is not disconnected from the child records if the user click on a new menu item etc.

Kev

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Handling Threads???
« Reply #3 on: September 18, 2010, 03:25:18 AM »
Hi Ron,

you can force the insert-when-a-form-starts approach Kevin mentions by selecting the option on the Advanced tab of the form.

However your root problem is correct, if a user starts something, and fails to complete it, you may need to "clean up" behind them.
Not so much the Session Queue - that will likely clear itself up - but rather file records.

What I've done in some cases is have a "complete" field in the table. Also perhaps a date, or time (or both) when the record was created. Complete is only set when the user clicks on Save.

Then if a record is "old" and "incomplete" then it gets removed by a garbage collector later on.

cheers
Bruce