Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

5.4. Continuous Execution

The RequestOptions object may be used to specify a special type of continuous async execution via the continuous or setContinuous methods. In continuous mode the statement will be continuously re-executed. This is intended for consuming real-time or other data streams processed through a SQL plan. A continuous query will only terminate on an error or when the statement is explicitly closed. The SQL for a continuous query is no different than any other statement. Care should be taken to ensure that retrievals from non-continuous sources is appropriately cached for reuse, such as by using materialized views or session scoped temp tables. A continuous query must return a result set, must be executed with a forward-only resultset, and cannot be used in the scope of a transaction. Since resource consumptions is expected to be different in a continuous plan, it does not count against the server max active plan limit. Typically custom sources will be used to provide data streams.
When the client wishes to end the continuous query, the Statement.close() or Statement.cancel() method should be called. Typically your callback will close whenever it no long needs to process results.
See also the ContinuousStatementCallback for use as the StatementCallback for additional methods related to continuous processing.