Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Configuring Query Timeout at the Descriptor Level

You can specify how the TopLink runtime handles the duration of queries on a descriptor's reference class. Specifying a query timeout at the descriptor level applies to all queries on the descriptor's reference class. A query timeout ensures that your application does not block forever over a hung or lengthy query that does not return in a timely fashion.

Table 28-4 summarizes which descriptors support query timeout configuration.

Table 28-9 Descriptor Support for Cache Refresh

Descriptor | Using TopLink Workbench | Using Java
--- | --- | ---
Relational DescriptorsFoot 1 |  |
Object-Relational Descriptors |  |
EIS Descriptor |  |
XML Descriptors |  |

Footnote 1 Relational class descriptors only (see "Relational Class Descriptors").

You can also configure a timeout on a per-query basis. For more information, see the following:

- "Configuring Named Query Advanced Options"

- "Configuring Query Timeout at the Query Level"

## Using TopLink Workbench

To configure how TopLink handles the duration of queries to this descriptor, use this procedure:

1. Select a descriptor in the Navigator. Its properties appear in the Editor.

2. Click the Queries tab. The Queries tab appears.

3. Click the Settings tab. The Settings tab appears.

   Figure 28-20 Descriptor Queries Settings Tab, Query Timeout Options

   Description of "Figure 28-20 Descriptor Queries Settings Tab, Query Timeout Options"

Field | Description
--- | ---
Default Timeout | TopLink throws a `DatabaseException` if a query on this descriptor does not return within the timeout period you configure on the parent descriptor. If there is no parent descriptor, the query timeout defaults to No Timeout.
No Timeout | TopLink blocks until a query on this descriptor returns.
Timeout | Enter the timeout period in seconds. TopLink throws a `DatabaseException` if a query on this descriptor does not return within this time.

## Using Java

Use `DescriptorQueryManager` method `setQueryTimeout` passing in the timeout value as a number of milliseconds.