Example #1
0
  /**
   * Creates a new DataContext with parent DataChannel and ObjectStore.
   *
   * @since 1.2
   */
  public DataContext(DataChannel channel, ObjectStore objectStore) {

    // inject self as parent context
    if (objectStore != null) {
      this.objectStore = objectStore;
      objectStore.setContext(this);
    }

    if (channel != null) {
      attachToChannel(channel);
    }

    if (objectStore != null) {
      DataDomain domain = getParentDataDomain();
      this.usingSharedSnaphsotCache =
          domain != null && objectStore.getDataRowCache() == domain.getSharedSnapshotCache();
    }
  }