Data.SqlExpr.TSQLConnection.MaxStmtsPerConn

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property MaxStmtsPerConn: LongWord read FMaxStmtsPerConn;

C++

__property unsigned MaxStmtsPerConn = {read=FMaxStmtsPerConn, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TSQLConnection

Description

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

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.

See Also