com.softwareag.tamino.db.api.accessor
Class TQuery

java.lang.Object
  extended by com.softwareag.tamino.db.api.accessor.TQuery
All Implemented Interfaces:
java.io.Serializable

public class TQuery
extends java.lang.Object
implements java.io.Serializable

TQuery represents a Tamino query expression. It wraps a Tamino query expression.

Version:
$Revision: 1.9 $
Author:
Marcus Schreyer
See Also:
Serialized Form

Constructor Summary
TQuery(java.lang.String expression)
          Initializes the query with the given query expression.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getExpression()
          Gets the query expression.
 TQuerySearchMode getQuerySearchMode()
          Gets the _querysearchmode parameter for this query.
static TQuery newInstance(java.lang.String expression)
          Factory method for the instantiation of a TQuery instance.
protected  void setExpression(java.lang.String expression)
          Sets the concrete query expression.
 void setQuerySearchMode(TQuerySearchMode querySearchMode)
          Sets the _querysearchmode parameter for this query.
 java.lang.String toString()
          Returns the String representation of this TQuery instance.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TQuery

public TQuery(java.lang.String expression)
Initializes the query with the given query expression.

Parameters:
expression - is the query expression.
Method Detail

newInstance

public static TQuery newInstance(java.lang.String expression)
Factory method for the instantiation of a TQuery instance.

Parameters:
expression - is the Tamino query expression.
Returns:
the TQuery instance.

setExpression

protected void setExpression(java.lang.String expression)
Sets the concrete query expression.

Parameters:
expression - is the Tamino query expression.

getExpression

public java.lang.String getExpression()
Gets the query expression.

Returns:
the Tamino query expression.

setQuerySearchMode

public void setQuerySearchMode(TQuerySearchMode querySearchMode)
Sets the _querysearchmode parameter for this query. Tamino version 4.1 onwards index access operations were made safe in the sense that they now deliver consistent results. That means, if a single query access multiple indexes, it is ensured that all these indexes reflect the same set of documents with the same document contents. For this implementation short-term locks on doctype level are used.

It has turned out that these �short-term� locks might live too long. Then, while a query request is reading indizes, concurrent updates have to wait until this short lock becomes available. To prevent starvation of these update requests, newly arriving read request have to queue up behind the update requests. As a consequence, even very short read requests need a long time until they can be processed.

To increase transaction throughput and to solve above mentioned problem we may require to process queries without these �short-term� doctype locks. But giving up the �short-term� doctype lock during index processing implies that one can no longer rely on many assumptions about the correctness of the result.

In order to specify that query request should not use "short-term" locks, set _querysearchmode=approximate i.e. TQuery.setQuerySearchMode(TQuerySearchMode.APPROXIMATE). Default value for this parameter is - "accurate"

Parameters:
_querysearchmode - parameter for this query.

getQuerySearchMode

public TQuerySearchMode getQuerySearchMode()
Gets the _querysearchmode parameter for this query.

Returns:
The _querysearchmode parameter for this query.

toString

public java.lang.String toString()
Returns the String representation of this TQuery instance.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.


Copyright (c) 2013 Software AG. All Rights Reserved.