Ask a question
For example, set up a membership number table ID CARDSN (member number) UID CARDSN is continuous like 031001, 031002 now has such a function click on a button to add 5 records and is continuous then each time you need to get the latest membership number and then use this as a benchmark for continuous generation of 5 number of plug The problem with databases is that if multiple users are working on the table at the same time, then each time the latest record is used to be inaccurate. Ask us how this problem should be solved
Reply to discussion (solution)
You can open a transaction.
If 5 users at the same time on the table operation, there is always a sequential, you can refer to the MySQL transaction processing, when you user action table, will lock the table, and so on, other users will continue to operate.
If concurrency is large, it is recommended that the Memcache queue be processed to relieve the pressure on the database tables.
Use queue form to process
If 5 users at the same time on the table operation, there is always a sequential, you can refer to the MySQL transaction processing, when you user action table, will lock the table, and so on, other users will continue to operate.
If concurrency is large, it is recommended that the Memcache queue be processed to relieve the pressure on the database tables.
Many other operations will use this table to lock the table will not affect other operations
Use queue form to process
Can you give me a specific idea?
Use things?
The first table, the end of the management and then the release.
? Test: http://koda.iteye.com/blog/471713
Use things?
The first table, the end of the management and then the release.
? Test: http://koda.iteye.com/blog/471713
Thank you for the knot.
Use things?
The first table, the end of the management and then the release.
? Test: http://koda.iteye.com/blog/471713
Can you ask a question my database is now a table of MyISAM type if you use the lock table in the unlocked form that other operations will not be affected when using this table for example, when you lock a table, you perform an insert operation, and another operation is to query the table. Will the query be affected?
The lock table is the original parallel operation into a serial operation
Of course to affect the performance of
The lock table is the original parallel operation into a serial operation
Of course to affect the performance of
The owner asked another question, such as the lock table when the purpose is to insert 5 records to this table other operations such as registration will also be inserted into this table data then there may be insert failure, right?
A table lock is used to create a queue, but does not cause an insert to fail
A table lock is used to create a queue, but does not cause an insert to fail
Thank you for your enthusiastic answer.
Thank you for your enthusiastic reply.