Search in sources :

Example 11 with Table

use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.

the class FileGdbRecordStore method getTableWithWriteLock.

protected Table getTableWithWriteLock(final RecordDefinition recordDefinition) {
    synchronized (this.apiSync) {
        final Table table = getTable(recordDefinition);
        if (table != null) {
            final String catalogPath = getCatalogPath(recordDefinition);
            final Integer count = Maps.addCount(this.tableWriteLockCountsByCatalogPath, catalogPath);
            if (count == 1) {
                table.setWriteLock();
                table.setLoadOnlyMode(true);
            }
        }
        return table;
    }
}
Also used : CodeTable(com.revolsys.record.code.CodeTable) DETable(com.revolsys.record.io.format.esri.gdb.xml.model.DETable) Table(com.revolsys.gis.esri.gdb.file.capi.swig.Table) FileGdbDomainCodeTable(com.revolsys.gis.esri.gdb.file.capi.FileGdbDomainCodeTable) VectorOfWString(com.revolsys.gis.esri.gdb.file.capi.swig.VectorOfWString)

Example 12 with Table

use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.

the class FileGdbRecordStore method releaseTable.

protected void releaseTable(final String catalogPath) {
    synchronized (this.apiSync) {
        final Geodatabase geodatabase = getGeodatabase();
        if (geodatabase != null) {
            try {
                final Table table = this.tableByCatalogPath.get(catalogPath);
                if (table != null) {
                    final Integer count = Maps.decrementCount(this.tableReferenceCountsByCatalogPath, catalogPath);
                    if (count == 0) {
                        try {
                            this.tableByCatalogPath.remove(catalogPath);
                            this.tableWriteLockCountsByCatalogPath.remove(catalogPath);
                            geodatabase.closeTable(table);
                        } catch (final Exception e) {
                            Logs.error(this, "Unable to close table: " + catalogPath, e);
                        } finally {
                            if (this.tableByCatalogPath.isEmpty()) {
                                this.geodatabaseReferenceCount--;
                            }
                            table.delete();
                        }
                    }
                }
            } finally {
                releaseGeodatabase();
            }
        }
    }
}
Also used : Geodatabase(com.revolsys.gis.esri.gdb.file.capi.swig.Geodatabase) CodeTable(com.revolsys.record.code.CodeTable) DETable(com.revolsys.record.io.format.esri.gdb.xml.model.DETable) Table(com.revolsys.gis.esri.gdb.file.capi.swig.Table) FileGdbDomainCodeTable(com.revolsys.gis.esri.gdb.file.capi.FileGdbDomainCodeTable) ObjectException(com.revolsys.beans.ObjectException) ObjectPropertyException(com.revolsys.beans.ObjectPropertyException)

Example 13 with Table

use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.

the class FileGdbWriter method deleteRecord.

private void deleteRecord(final Record record) {
    final Table table = getTable(record);
    this.recordStore.deleteRecord(table, record);
}
Also used : Table(com.revolsys.gis.esri.gdb.file.capi.swig.Table)

Example 14 with Table

use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.

the class FileGdbWriter method updateRecord.

private void updateRecord(final Record record) {
    final Table table = getTable(record);
    this.recordStore.updateRecord(table, record);
}
Also used : Table(com.revolsys.gis.esri.gdb.file.capi.swig.Table)

Aggregations

Table (com.revolsys.gis.esri.gdb.file.capi.swig.Table)14 FileGdbDomainCodeTable (com.revolsys.gis.esri.gdb.file.capi.FileGdbDomainCodeTable)10 CodeTable (com.revolsys.record.code.CodeTable)10 DETable (com.revolsys.record.io.format.esri.gdb.xml.model.DETable)10 Geodatabase (com.revolsys.gis.esri.gdb.file.capi.swig.Geodatabase)6 RecordDefinition (com.revolsys.record.schema.RecordDefinition)5 VectorOfWString (com.revolsys.gis.esri.gdb.file.capi.swig.VectorOfWString)4 ObjectException (com.revolsys.beans.ObjectException)2 ObjectPropertyException (com.revolsys.beans.ObjectPropertyException)2 PathName (com.revolsys.io.PathName)1 DEFeatureClass (com.revolsys.record.io.format.esri.gdb.xml.model.DEFeatureClass)1 Field (com.revolsys.record.io.format.esri.gdb.xml.model.Field)1 SpatialReference (com.revolsys.record.io.format.esri.gdb.xml.model.SpatialReference)1 RecordDefinitionImpl (com.revolsys.record.schema.RecordDefinitionImpl)1 RecordStoreSchema (com.revolsys.record.schema.RecordStoreSchema)1