Suntower
Posts: 225
|
| Posted: 04/26/2005, 12:32 PM |
|
I am new to 'stateless' programming so I am wondering if someone could suggest how to handle web-basedorder entry where one needs a typical header/detail transaction.
The user typically enters one or more rows into a detail table, then saves the transaction with a row in a header table. Or the header row is added first, then the user enters detail rows. Either way, one needs to be able to clean up if the user aborts the transaction.
So: how does one handle this in a webserver environment where users may well simply walk away from their screen and leave the session open, or close their browser, or....
Are there server timeouts one can poll and processes which can be automatically set to scrub incomplete transactions?
TIA,
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
Ju
|
| Posted: 04/26/2005, 4:08 PM |
|
I recommend that you use session variables to store the information that the user enters. Then the system only enters the session variable values into the database tables when the transaction is being completed.
|
|
|
 |
Suntower
Posts: 225
|
| Posted: 04/26/2005, 5:39 PM |
|
Sorry, I don't think I follow.
Are you saying that -all- the user's data entry should be to variables and that NO rows are written to the db until the user submits the transaction?
How would that work within CodeCharge Studio? It seems that the designer screens are all oriented towards working with tables. Isn't what you're suggesting basically doing -all- header/child transactions in hand code?
What am I missing?
Thanks,
---JC
Quote Ju:
I recommend that you use session variables to store the information that the user enters. Then the system only enters the session variable values into the database tables when the transaction is being completed.
_________________
---On a campaign for more examples and better docs! |
 |
 |
peterr
Posts: 5971
|
| Posted: 04/26/2005, 8:02 PM |
|
You should definitely not use sessions for this.
Use the standard functionality and cleanup the database later as you pointed initially. You may need to cleanup once a day or at other intervals.
I don't think that a server can automatically execute a program on session timeout but possibly some servers/technologies do. Please be specific about the technology you're using and possibly someone will point a solution.
BTW, I don't think that this issue is specific to Web applications. Many client/sever solutions allow creating a header record first, then adding details later. Usually such applications allow users to come back later and edit the order, add extra detail lines, etc.
Therefore I would handle it the same way in Web applications as in any other applications, without cleanining up the data. If you have a page that displays the list of orders you can let the users edit those unfinished ones, maybe even set some flags indicating which ones were unfinished (don't have detail).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|