Hitachi

uCosminexus Application Server Compatibility Guide


13.4 Query hint

In Cosminexus JPA Provider, you can specify a query hint in the hint element that is the lower element of the named-query element in the O/R mapping file. Note that you can also specify the query hint in the @Hint annotation of the argument for the @NamedQuery annotation. For details on the query hint to be specified for annotations, see 8.12.53 @QueryHint.

The following table describes the query hints that can be specified in the hint element that is the lower element of the named-query element in the O/R mapping file:

Table 13‒68: Query hints that can be used in Cosminexus JPA Provider

Key name

Description

Specifiable value

Default

cosminexus.jpa.pessimistic-lock

Specifies whether the pessimistic lock will be used.

NoLock

The pessimistic lock will not be used.

Lock

The pessimistic lock will be used.

If the target table is already locked, the release of the lock will be awaited.

  • In Oracle

    SELECT ... FOR UPDATE will be issued.

  • In HiRDB

    SELECT ... WITH EXCLUSIVE LOCK will be issued.

LockNoWait

The pessimistic lock will be used.

If the target table is already locked, an exception will occur.

  • In Oracle

    SELECT ... FOR UPDATE NO WAIT will be issued.

  • In HiRDB

    SELECT ... WITH EXCLUSIVE LOCK NO WAIT will be issued.

NoLock

Note:

The data type that can be specified is String.

Important note

If a value outside the specifiable range is set for a query hint specified in the O/R mapping file, an exception will occur when the application starts. Note that the value is not case sensitive.