Problem: an operation interface in different hosts many people may be used at the same time, how to save the data interface to the database?
CodePudding user response:
Custom login, save them separately according to the userCodePudding user response:
Agree with the upstairs, can also be saved to the INI file or personal custom interface to the local database,CodePudding user response:
No difference, and 1 computer normal append/edit, postWhen there is a concurrent only will rob the phenomenon of single, want to deal with the
CodePudding user response:
This need why not consider BS structure?CodePudding user response:
Seems to understand my intention, only the third floor can database locking mechanism can solve the problem?CodePudding user response:
Directly to the c/s structure, a sign of judgment with data, comparison USES B/s structure, I have recently been locked, B/s Delphi seems not very appropriate,CodePudding user response:
All c/s and b/s application doIf to edit a record at the same time, there are conflicts, the problem of dirty data, by special marks at the same time can only be an edit control
CodePudding user response:
Use things, to the SQL to deal with dirty dataCodePudding user response:
This is a typical C/S design, key to see how you connect database,Personally think that ADO connection as well, ADO has multi-user concurrent processing mechanism, do not need to users to worry about,
If there are multiple users to deal with a record, can be in positive or negative lock lock,
CodePudding user response:
It is best to separate operation, the working according to user's login to extract records, each person can only change their add records, to query, the open window,CodePudding user response:
The reference # 9 floor:This is a typical C/S design, key to see how you connect database,
Personally think that ADO connection as well, ADO has multi-user concurrent processing mechanism, do not need to users to worry about,
If there are multiple users to deal with a record, can be in positive or negative lock locking,
This three words is very right, I in the interface code to INSert and Update all take things to protect, the key you said "ADO has multi-user concurrent processing mechanism, need not worry users", how to understand?
My 1 interface data corresponding to the data in the database table is divided into operation records and operation history record, when user open operation interface, first will show all the unfinished project corresponding operation (form), if today's operating record has a task to complete, the user can delete this task in the operating screen saved to operating history records, the interface data to save, the first thing I operated by interface code to delete all the data in the form, with the data in the loop to save operation interface, concerns have: when many people at the same time operating this interface, the consistency of the data will take place?
CodePudding user response:
No special marks to control, on pure transaction, locks, there may be problemsBecause the user to enter editing to cancel or complete, is a long process, even in the middle of may crash offline
Lock so long, must be bad
CodePudding user response:
Sz_haitao:No special identity, how to understand and implement?
CodePudding user response:
I feel or background of the problem, use memory table association of Taiwan before and after data, once submitted, the background to solve the problem of conflict,CodePudding user response:
The phenomenon of business processing mechanism determines how to use the locking mechanismCodePudding user response:
Is some of the ways to add or remove modifyCodePudding user response:
A lot of crap final solution hereCodePudding user response:
Delete the changes under the lockCodePudding user response:
The most common to this problem should be! Without database lock what of, was a complete programming can be achieved, so several solutions to choose from:1, the primary key in sequence, can be added in sequence (Oracel database), SQL on the field, this should be no problem,
2, for each customer assigned a unique number, according to the client when a client login number + serial number to generate a primary key, there is no this kind of question,
3, and the second is similar to the serial number of the logged in user + serial number to generate a primary key can also!
Think of these methods for a while. Don't know whether to satisfy your condition is not!
CodePudding user response:
To clarify the problem first, any requirements,CodePudding user response:
Still use identifiers, locking is not reliable.CodePudding user response:
If use a relational database, the table has primary key,If use Delphi DataSet to submit data, other users to modify the record, the TDataSet identifies by field had been other user changes, so as to return information, failure
If you use SQL statements submitted data (a submit data from multiple tables), SQL statements to consider to concurrency issues, check whether the raw data before submitting data changed, generally with the default transaction to implement, can be different transaction locks, different requirements using different locks, lock, and transaction is used to solve the problem of concurrency,
The general process:
1, get the original data from DBS (multiple tables) - & gt; 2, the display interface - & gt; 3, modify, or calculate the new data - & gt; 4, submit the data to the DBS (multiple tables)
Concurrent, want to consider in 4, before submit the data to the DBS, check whether the raw data changes, with a locking mechanism to lock multiple tables, the users often unrealistic and
One way to check whether the raw data changes: calculate MD5 value of all the raw data, as a result of a written to the database as a transaction identifier, maintain the affairs on its own identity than locking mechanism, and can get higher performance,
Different data, different requirements, there are different implementations, this is the program design, rather than copy,
CodePudding user response:
Waiting for the master answer!