Jump to content

Payment System Question

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
twalters84

twalters84

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts
Greetings,

I am currently making a payment system.

I am wondering what happens if a multiple buyers send a coder payment at the same time?

When each payment occurs, I use coldfusion to look up the current money amounts for the buyer and coder. I do the necessary calculations to transfer money and then update the database.

What happens if during the 2nd payment, the origal amount is set before the first payment is updated?

Is there a way to lock a table in the database until the first payment is complete?

Any help will be greatly appreciated! Thanks in advance!

Sincerely,
Travis Walters
admin@codebuyers.com
spammy sig deleted

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
This should be placed in the correct database section, please tell us what engine you are using. And yes, most databases allow locking.

#3
twalters84

twalters84

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts
Hey there,

Thanks for the prompt response.

I am using a MS SQL Server 2005 database and Coldfusion to manipulate it.

Thanks in advance for anymore information you can provide me with.

Sincerely,
Travis Walters
spammy sig deleted

#4
twalters84

twalters84

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts
Found the solution I was looking for here:

Macromedia - Devnet: Controlling Database Transactions in ColdFusion MX

Very nice article for those who have the same issue :)
spammy sig deleted

#5
twalters84

twalters84

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts
Hey there,

I was just wondering if I have a piece of code that is locked with cftransaction, and another piece of code that tries to access the locked rows simultaneously, what will happen with that other piece of code?

Will that other piece of code wait until the first transaction is complete?

Do I need to place a loop around the cftransaction to make sure it executes?

Thanks for any clarification you guys can give me :)

Sincerely,
Travis Walters
spammy sig deleted

#6
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Although I don't know for sure, I imagine you will get a database error of some kind. The best way to know is to try it. Create a test DB and lock rows in it. Try to access those locked rows and see what happens.

You may need to catch the error, wait xx seconds and try again.