Home > Back-end >  Delphi has developed a three layers structure refreshes the problem in the program
Delphi has developed a three layers structure refreshes the problem in the program

Time:11-13

Everybody is good, I want to ask you a question!
I use Delphi to develop a three layers structure of program:
Application server: TRemoteDataModule, TADODataSet TDatasetPrivder,
Client: TSocketConnection, the TClientDataset,
My system is more users (customers) at the same time of operation, for example, each customer has its own product files, but stored in a table, the table by the client code, and add and delete file is only for your products,
But after modify a record, I need to show the lookup type field, so I just ClientDataset. Refresh to Refresh, but because many customers modify their files at the same time, a Refresh, it may become a another customer files,
I know, this is a server TDatasetPrivder space, but what should I do, can solve this problem?

CodePudding user response:

TRemoteDataModule instance of the model into multiple instance, thread model, to be free,

CodePudding user response:

One of my DataSnap, the original is aimed at individual users, due to the customer, opened up a new body, so, have to be changed to multiple clients,
I am such a change:
1, set up a table, recording the unit name and abbreviation of the branch (identification character), let a client, to obtain an identifier,
2, all the tables, add a FC fields, through the character, can be the difference, the data is the institutional clients,
3, all data read and write, add a condition where FC='branch characters'

In this way, it is much customers DataSnap program, due to the increased recognition fields, read and write data won't make a mistake,

CodePudding user response:

Jjpweb, hello!
I use the thread model is tmApartment, no? What is the difference between tmApartment and tFree? TFree can have what sequela, for that is what I need to pay attention to possible joint and several other problems?

CodePudding user response:

Lyhoo163, hello!
What I use is the way that you said, but no, may I not describe my question clearly, so you didn't understand my mean!
My product after DBgrid has need to modify the documents show to display the type of lookup fields, like do not refresh will not regain some of the lookup type field values, so I must clientdataset. Refresh, so there is a kind of phenomenon, I described in the problem
And I try, as long as I don't refresh, there is no problem, but is a little uncomfortable, can't show the updated value of a field in a lookup type,

For example:
I have a product classification table, table has two records, (001), men's shoes) and (002, women's shoes),
I have a field in the product file called "product category", he cited the product classification, I in the product file, save only product categories worth 001, but in the DBGrid show, I need to display 001 and men's shoes these two information, so I use the lookup type field, but when I maintain, I take 001 to 002, so I need to show is 002 and women's shoes, so I need to clientdataset, refresh, or lookup type field does not automatically display into women's shoes,

CodePudding user response:

Apartment should also go, you haven't the provider in remotemodule?

CodePudding user response:

Jjpweb, hello!
The provider is in remotemodule me, see what you mean, is such a problem, should not be I

CodePudding user response:

Not sure what you mean!

CodePudding user response:

The original poster with application server: TRemoteDataModule TADODataSet, TDatasetPrivder,
Client: TSocketConnection, do the TClientDataset development
Will encounter this problem to ask

Client if you don't query operation for a period of time, connection will be closed, cannot undertake the following database operations, the client SQL error to "close the connection" (but in the middle tier SCKTSRVR found no release connection, if the time won't have this kind of phenomenon of partition) I'm silly way is to meet this kind of situation I am in application to reconnect once, but is in the middle tier many produced a connection, if often have such things happen, the middle tier SCKTSRV will produce a lot of the same connection, more than the original customer number at the same time when there are 150 or so, if repeated connection can't release, you can want to the seriousness of the problem, so can't often have a client, the client error as the "target actively refused to", the problem must be the number of connections because of too much, how do I debug can release those invalid connection, very irritated ah. Hope experienced player can introduce how to release those invalid connection

  • Related