MySQL NDB Cluster API Developer Guide

4.3.1.9 ClusterJTableException

ClusterJTableException is used for reporting all "Table Not Found" conditions in Cluster/J. This includes "Table Not Found" with no associated errors, as when Cluster/J attempts to get metadata for a named table, but the named table is not defined in NDB, and no other errors are reported. It also includes "Table Not Found" with some additional error, such as a network error. The presence of the accompanying error raises some uncertainty about whether the named table may or may not exist in the database. ClusterJTableException is derived from class ClusterJDatastoreException, and in both the error and no-error cases, ClusterJDatastoreException.tableNotFound() will return true. In the case with an additional error, the method ClusterJTableException.hasError() will also return true. ClusterJTableException also provides methods for reporting the name of the table used in the search, and the elapsed time spent attempting to get the table. Commonly, a Cluster/J application may expect a table to exist, but have to wait some unspecified amount of time for some other system to create the table. Waits of any duration can be implemented. Short waits can be managed by setting the SessionFactory property com.mysql.clusterj.table.wait.msec to an integer value between 0 and 1000. This value is used as a time limit in a sleep-and-retry loop inside Cluster/J, and will be applied during every attempt to open a table. Longer waits can be managed by the application looping around a call such as session.newInstance(), testing for ClusterJTableException, and then using elapsedMillis() to account for the elapsed time reported by each exception. Before Cluster/J version 9.4.0, some "Table Not Found" conditions were reported using ClusterJUserException, without any checks for an underlying error, and others were reported with ClusterJDatastoreException.

4.3.1.9.1 Synopsis
 public class ClusterJTableException extends, ClusterJDatastoreException {
// Public Fields  public final long endNanos ;
  public final long startNanos ;
// Public Constructors  public ClusterJTableException(String tableName,
                                long start,
                                long end,
                                String msg,
                                int code1,
                                int code2,
                                int status,
                                int classify);

// Public Methods  public int elapsedMicros();
  public int elapsedMillis();
  public long elapsedNanos();
  public String getTableName();
  public boolean hasError();
}

Methods inherited from com.mysql.clusterj.ClusterJDatastoreException: awaitSchemaChange , canRetry , forSchemaChange , getClassification , getCode , getMysqlCode , getStatus , isSchemaChangePending , isStaleMetadata , setRetriable , tableNotFound

Methods inherited from com.mysql.clusterj.ClusterJException: printStackTrace

Methods inherited from java.lang.Throwable: addSuppressed , fillInStackTrace , getCause , getLocalizedMessage , getMessage , getStackTrace , getSuppressed , initCause , setStackTrace , toString

Methods inherited from java.lang.Object: equals , getClass , hashCode , notify , notifyAll , wait