[eluser]WanWizard[/eluser]
I didn't say that. I said transations don't solve the issue.
If you use (in a MySQL context) MyISAM tables, you don't need/can't use transations. First, because it's not supported, but also because the MySQL engine works sequential. You can not have simultaneous updates on a table. If you use InnoDB, you can.
Our solution works table-based, so it doesn't matter how many tables are involved. Transations might come in handy, as they allow you to roll back all updates within a transation at one, and might be required to secure consistency. But that's diffferent from concurrency.
As about expensive: disk space is cheap, I don't worry at all about the few extra bytes, even for large databases. Tests on one of our larger sites has shown that this solution in combination with MyISAM tables was a lot faster than using transactions and InnoDB. Offcourse, YMMV, it might depend on your update to read ratio's. We don't use MySQL's "ON UPDATE CURRENT_TIMESTAMP" feature, as that is not portable, we use a microtime() based function to determine the timestamp.
Retrying a failed transaction is pointless, so I'm not sure what you're trying to archieve there. There aren't that many reasons why a transaction that fails the first time would succeed the second time.
But, you missing the point. A transaction ensures that I can do a set of modifications without being interrupted by someone else. So, to keep the data consistent.
The issue here is this: I retrieve a record and populate a form. Then I go for a cup of coffee. In the mean time, you do the same, update the data, and save the form. Now I come back to my desk, and I don't know that the form in front of me contains invalid data. I post the form to save the data, which succeeds because the records aren't locked, and overwrite your updates. Transactions are not going to solve this, as they are only valid within a single process. HTTP (and therefore PHP) is stateless, when your script ends all locks will be released. You can not transfer a transaction lock to a next page request (nor would you want to, the chance of a deadlock is very real).
The 'appropriate action' has to be manual, because it depends on the situation. In case of a user posting a form, you could return to the form with a message 'sorry, someone else has beaten you to it', and populate the form with the new data from the updated record. In case of a workflow process (an action on a record triggers a workflow, but the record is modified before the workflow process starts) you can't do that, you have to abandon the workflow, generate error messages, etc.