ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
A high performance database engine using optimized data access for all development environments including Delphi, Visual Studio .NET, Visual Basic, Visual FoxPro. and more. Learn More
  #1  
Old August 14th, 2003, 10:52 AM
victoria207 victoria207 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Baltimore, MD
Posts: 9 victoria207 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 52 sec
Reputation Power: 0
Angry Data persistance in Cold Fusion

I have 5 pages taking employee information as input (Personal data, Education, Working Exp, Projects, Skills etc) I am using javascript for client side validation and Cold Fusion on the server side. I want to persist data from first to last form so that at end of submission user can verify the data from all 5 pages , then it will be posted in the data base. Please help!!! Thanks

Reply With Quote
  #2  
Old August 14th, 2003, 03:01 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,223 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 32 m 57 sec
Reputation Power: 174
You could write the filled-out data to <input type=hidden> tags on each subsequent page of the form... that way, all of the data stays until you're ready to submit to the DB.

Alternately, you could write the data to the database in sections, but you would need to determine which user was writing to which part of the DB as you went along. I'm sure CFML has a 'session' ID similar to that of PHP that you could use to link the 2 for this purpose.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever.
Analyze twice; hack once.
The world's first existential ITIL question: If a change is released into production without a ticket to track it,
was it actually released?


About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect -
Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire


Reply With Quote
  #3  
Old August 14th, 2003, 03:17 PM
victoria207 victoria207 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Baltimore, MD
Posts: 9 victoria207 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 52 sec
Reputation Power: 0
Code

<input type=hidden> tag is not an option here since I have about 100 questions and 5 pages to post. I was thinking about using session variables, but never built anything using session variable from scratch. SO if someone can send me a code example on how to use session variable I would appretiate it!
Thanks

Reply With Quote
  #4  
Old August 14th, 2003, 06:44 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,474 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 16 h 54 m 28 sec
Reputation Power: 42
Using session variables in CF is absurdly easy.

First, make sure you put a <cfapplication> somewhere that will run on each request, most likely the Application.cfm file. Something like this:

<cfapplication name="myAppName" sessionmanagement="Yes">

Then, when you want to set a session variable, you do:

<cfset session.myVar = "whatever">

To read it, you do:

#session.myVar#

That's it.

The only other thing to note is that if you plan on a decent load on the server, you should use <cflock> to lock reads and writes to session variables. Since they are memory-resident, you must avoid memory contention by locking if you expect a heavier load. But this is not required (it is recommended though).

Example:

<cflock timeout="" throwontimeout="No" name="#createUUID()#" type="EXCLUSIVE">
<cfset session.myVar = "whatever">
</cflock>

<cflock timeout="" throwontimeout="No" name="#createUUID()#" type="READONLY">
<cfset someLocalVar = session.myVar>
</cflock>

A well thought out application will minimize the need for locking by locking once at the start of the request to copy the session vars into the local scope, and then at the end of the request copy them back into the session scope.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Data persistance in Cold Fusion


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway