Transaction start / commit

prevent multiple users from ordering the same last ticket.

Overview

The problem occurs when multiple users simultaneously see and try to order the last available ticket, leading to overselling.
Mark the ticket as taken immediately after the first successful form submission and check availability on each form submit, rather than using database transactions.

Answered
ChronoForms v7
Ed Eddi Bournell 18 Apr, 2025

I want to prevent DB-conflicts  because of many users start orders  in my shop-system simultaneously.

Can I use Transaction start / commit ? Or what are these actions for?

Max_admin Max_admin 19 Apr, 2025

Hi Eddi

it depends on the kind of conflict you want to prevent, what is the current problem you are having ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Ed Eddi Bournell 19 Apr, 2025

I am working on a ticket-ordering-system for a small Theater.

Szenario: 

  • We have 1 tiket left.
  • costumer 1 opens the orderform , sees 1 Ticket left
  • costumer 2 opens the orderform , sees 1 Ticket left too
  • costumer 3 opens the orderform , sees 1 Ticket left too

When each of them presses the "order now" button and submits the form, they all get an "Order OK-Message".

I want the first costumer, who submits ,  to win the order.

Can I use the autocommit off /on mechanism in CF7??

Are CF7 DB-actions Transaction start /Transaction commit solutions to my Problem?

Beside that, I like to know , what is the function of these actions?

Eddi

Max_admin Max_admin 05 May, 2025
Answer

Hi Eddi

Apologizes for the late reply

You can mark a ticket as taken after the first user sends the form and read the availability on form submit for each user, that would solve the problem I think, you do not need transactions here

if you need to understand database transactions then you can read about them here

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply