From RAD Studio API Documentation
Jump to: navigation, search


property AutoClone: Boolean read FAutoClone write FAutoClone default True;


__property bool AutoClone = {read=FAutoClone, write=FAutoClone, default=1};


Type Visibility Source Unit Parent
property public
Data.SqlExpr TSQLConnection


Specifies whether the SQL connection automatically clones database connections when they are needed.

AutoClone controls whether the TSQLConnection component automatically creates duplicate database connections when the number of statements allowed by the database server is exceeded. By default, AutoClone is true, meaning that when the ActiveStatements property is the same as MaxStmtsPerConn, trying to execute another statement (open another dataset or call the Execute method) causes TSQLConnection to open a secondary (cloned) connection. The result behaves just like a connection to a server that does not limit the number of statements, except that it consumes more resources (for the additional, cloned connections).

Change AutoClone to false to prevent TSQLConnection from cloning the database connection when the application attempts to exceed the maximum number of statements. When AutoClone is false, attempts to exceed MaxStmtsPerConn result in an exception.

Tip: When AutoClone is false, you can check the ActiveStatements property to ensure that you do not exceed the server-imposed limit on the number of statements. If you are about to exceed that limit, you can explicitly call CloneConnection to clone the connection yourself.

See Also