此内容没有您所选择的语言版本。

3.3. Load Balancing


Post connection load balancing can be utilized in one of two ways.
If you are using the TeiidDataSource class and the PooledConnection returned by getPooledConnection is terminated using the close() method, then a new server instance will be selected automatically. (When using driver based connections or when using the TeiidDataSource class in a connection pool, the automatic load balancing will not happen.)
Alternatively, you can explicitly trigger load balancing through the use of the set statement: SET NEWINSTANCE TRUE. Typically you will not issue this statement manually, but you can use it as the connection test query on your data source configuration:
<datasources>
        <datasource jndi-name="java:/teiidDS" pool-name="teiidDS">
            <connection-url>jdbc:teiid:{vdb}@mm://{host}:31000</connection-url>
            <driver>teiid</driver>
            <pool>
                <prefill>false</prefill>
                <use-strict-min>false</use-strict-min>
                <flush-strategy>FailingConnectionOnly</flush-strategy>
                <check-valid-connection-sql>SET NEWINSTANCE TRUE</check-valid-connection-sql>
            </pool>
            <security>
                <user-name>{user}</user-name>
                <password>{password}</password>
            </security>
        </datasource>
        <drivers>
            <driver name="teiid" module="org.jboss.teiid.client">
                <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
                <xa-datasource-class>org.teiid.jdbc.TeiidDataSource</xa-datasource-class>
            </driver>
        </drivers>
    </datasources>
Copy to Clipboard Toggle word wrap

Important

Session level temporary tables, currently running transactions, session level cache entries, and PreparedPlans for a given session will not be available on other cluster members. Therefore, it is recommended that post connection time load balancing is only used when the logical connection could have been closed, but the actual connection is reused. This is the typical connection pool pattern.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat