Using Query Pooling


Query pooling allows an application to reuse queries that have been executed. If your Java application executes the same query more than once, you can improve performance by enabling DataDirect XQuery’s internal query pooling. When query pooling is enabled, DataDirect XQuery caches a specified number of queries executed by an application. DataDirect XQuery pools queries executed using XQExpression and XQPreparedExpression.

Using XQJ, you can enable query pooling by specifying the DDXQDataSource MaxPooledQueries property. For example, if the DDXQDataSource MaxPooledQueries property is set to 20, DataDirect XQuery caches the last 20 queries executed by the application. If the value set for this property is greater than the number of queries used by the application, all queries are cached. See DDXQDataSource and DDXQJDBCConnection Properties for more information.