Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Big Problem, about Coldfusion. Any one has met before

Status
Not open for further replies.

wminghao

Programmer
May 29, 2000
24
US
Hi, everybody:

I used coldfusion for the website of my company since this August. Everything works fine, except one minor problem:

In my program, before I write anything into the database, every informaiton is stored in the session, including price, quantity, totalprice... And the session is supposed to be stored in server memory. At the last step of checkout, I write info into databse.

But today I met a problem, I got the wrong quanity, right price, and right totalprice which is stored in my order table. For example, quantity=11(instead of 2), Price=$10
and totalprice=$20
So it means, the session variable is not coordinated before writing to the DB and doing the calculation.

I believe it must be a bug in Coldfusion, since I run my website for so many times without calculation mistakes like that.

I don't know what is the reason. My Web server is NT 4.0 plus CF4.5, running on PIII 450 and so is Database server, which is using Oracle. Memory of my server is also very big:
512MB.

I try to ask if you have met the same problem before.
Let us discuss about that.

Thanks
 
The problem may be that it mixed up two different sessions. I was actually reading about this problem just a few minutes ago while researching another session variable problem I'm having. You may be able to solve the problem using the cflock tag. I'm inexperienced in it's use but I read that sometimes if two different users are initiated at the same time (via cfapplication) they can be assigned the same session ID. Obviously in this scenario data corruption is likely. Appearantly if you define your variables within a cflock tag then the user is guaranteed a unique ID. That't about all I know but I hope it puts you on the right track.

Andrew
amayer@sonic.net
 
It is true, cflock should take care of it if this problem is a result of session corruption. Session variables can be corrupted if two users are writing to that same variable at same time. CFLOCK throws it into a single thread which makes each session write occur before the next one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top