RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLConnection.MaxStmtsPerConn Property

Indicates the server limit on the number of statements supported by a single database connection.

Pascal
property MaxStmtsPerConn: LongWord;
C++
__property LongWord MaxStmtsPerConn;

Read MaxStmtsPerConn when a connection is active to determine whether the database server imposes a limit on the number of statements that can be executed using the current connection. When MaxStmtsPerConn is 0, the server imposes no restrictions: a single database connection can be used to fetch multiple datasets and execute statements while there are active datasets. When MaxStmtsPerConn is greater than 0, the database server limits the number of statements that can execute. The server allows only MaxStmtsPerConn datasets to be opened using a single connection, and when that number of datasets are open, no more statements can be executed (for example, using the Execute method). 

By default, when MaxStmtsPerConn is greater than 0, TSQLConnection clones the database connection when this server-imposed limit is reached. For example, if MaxStmtsPerConn is 1, then trying to open a second dataset using the same TSQLConnection component causes TSQLConnection to establish a second database connection for the second dataset. If AutoClone is false, however, TSQLConnection does not clone connections, but rather generates an exception when the application tries to exceed MaxStmtsPerConn.

Note: The value of MaxStmtsPerConn is only valid when the Connected property is true.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!