Home > Back-end >  Is my in indytcpserver onExecute dynamically create a TADOConnection problem is the program running
Is my in indytcpserver onExecute dynamically create a TADOConnection problem is the program running

Time:09-26

I have a very urgent problem, is I in indytcpserver onExecute every receiving a TCP text information can be dynamically created a TADOConnection, put the words written to the database, complete disconnect from the database after writing database and used his TADOConnection FREE release, problem is the program running about 12 days or so will be unable to connect to the database, turn off the program to open also not line, you have to restart the computer to connect to the database properly, what reason is this excuse me?? Using XP, sql2000 database

CodePudding user response:

Restarting, troubleshooting, the key is the memory problem, problem is twofold:

A, the operating system problems
The failures of the operating system itself,

Second, the server code problems
1, inner occupy, the release of the incomplete,
2, and the failure of the thread and the server program is thread mistakes I make miserably,

No code, imagined, are for reference only.

CodePudding user response:

Why each connection to a database connection, database connection usually just one or two long connection, and then through the queue service,

CodePudding user response:

Memory is full or the number of connections is full

CodePudding user response:

Why don't you try to restart the SQL server server?

CodePudding user response:

Even determines the SQL server run out of service due to handle problems,
You also are problems of this kind of writing method,

Improved a little bit more simple, can will need to write the content, in a List,
In another thread, read the contents of the List, write operations, a TADOConnection done, also need not repeat creation,

CodePudding user response:

Suggestions don't create TADOConnection, but use, is a low global static TADOConnection, try,

CodePudding user response:

This time, will long even database, because the program is running on the server side,
Look from the phenomenon, should be a resource is exhausted,
After the turn off the process, to determine whether the process of program still exist?
If not, may be the cause of the database, but in the end, or your program problem,
If there is, may be program,
In a word, is to write program has a problem,

CodePudding user response:

Don't always create the connection, the Server using a static long connection, through the message or thread synchronization to operation,

CodePudding user response:

The number of connections, I met
  • Related