I assume that you are storing the "working" copy of the details in a temp location such as the session scope or a temp database table.  It doesn't matter much, either way, as long as your program is aware that someone is working on data that hasn't yet been committed to the DB.
 
While the user is working on the details, can you just show a big, bold message that says, "The data has not yet been saved. You must committ the data or it will be lost."?
 
The main problem with the memory-based scopes (session, application, etc) is that they will be lost if the server crashes.  You also have the issue of clustering/load balancing where the details may not be aware of multiple instances/servers.
 
I would create a "working" table/record that stores all the details while the user is messing with it, then when they are satisfied with the details, they commit it.  The commit actually copies the data from the working table/record to the production table/record.
 
BTW, would you mind sharing your little application?  I certainly would like to see it.  We are about to undergo a large rebuild of our intranet and I'm gathering all the information I can before I really dig in.
 
Thanks
M!ke


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Kear
Sent: Wednesday, October 26, 2005 3:21 AM
To: [email protected]
Subject: [CFCDev] Making changes before a commit button

I'm feeling pretty proud of my self today - for the first time, I wrote, unaided, with no safety net, a small app, which uses a CFC Bean to handle the variables in the object,   then a CRUD.cfc to insert the details to a SQLServer table.   This app doesnt do much worth anything, except prove to me that I have learned enough  that I can write using this OOP method, without copying off other people's stuff.    This is a MAJOR milestone for me!
 
Anyway, the way this app works is that a user is presented a form,  can make all the changes and tweaks he wants to the details before finally committing the details to the database.   The bean cfc contains all the data while the user tinkers around with it,  then passes it to the CRUD.cfc when the time comes to commit the data to the database.
 
So here's a potential problem I haven't put a lot of thought into before, but must have been dealt with by others, and now i realise it's really vital to solve:
 
[Q]  How do you ensure that the user clicks the "commit" button before leaving the application?    There would be a risk I'd have thought, that the user can complete the forms, tinker around with the data getting it right, thinking it's been added to the database, but it really hasnt.  It's still in the bean cfc waiting for the user to commit it.    (If it was  a  simple form, i would make the submit button commit the data to the database right then and there, but the kind of app I'm thinking of using this process is where there is quite complex interrelated data to deal with - such as a page definition in a CMS or multi-stage wizard form where the data required in one part depends on what was supplied to another. )
 
 
I know I've seen these kinds of apps before, but never thought much about what was going on in the background before. 
 
 

Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to