use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.
the class FileGdbWriter method insertRecord.
private void insertRecord(final Record record) {
final Table table = getTable(record);
this.recordStore.insertRecord(table, record);
}
use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.
the class FileGdbRecordStore method closeTables.
private void closeTables() {
synchronized (this.apiSync) {
if (!this.tableByCatalogPath.isEmpty()) {
final Geodatabase geodatabase = getGeodatabase();
if (geodatabase != null) {
try {
for (final Table table : this.tableByCatalogPath.values()) {
try {
table.setLoadOnlyMode(false);
table.freeWriteLock();
geodatabase.closeTable(table);
} catch (final Throwable e) {
} finally {
try {
table.delete();
} catch (final Throwable t) {
}
}
}
this.tableByCatalogPath.clear();
this.tableReferenceCountsByCatalogPath.clear();
this.tableWriteLockCountsByCatalogPath.clear();
} finally {
releaseGeodatabase();
}
}
}
}
}
use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.
the class FileGdbRecordStore method updateRecord.
@Override
public void updateRecord(final Record record) {
if (record == null) {
} else {
final RecordDefinition recordDefinition = record.getRecordDefinition();
final Table table = getTableWithWriteLock(recordDefinition);
try {
updateRecord(table, record);
} finally {
releaseTableAndWriteLock(recordDefinition);
}
}
}
use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.
the class FileGdbRecordStore method getTable.
protected Table getTable(final RecordDefinition recordDefinition) {
synchronized (this.apiSync) {
synchronized (API_SYNC) {
final RecordDefinition fgdbRecordDefinition = getRecordDefinition(recordDefinition);
if (!isExists() || fgdbRecordDefinition == null) {
return null;
} else {
try {
final Geodatabase geodatabase = getGeodatabase();
if (geodatabase == null) {
return null;
} else {
final String catalogPath = getCatalogPath(fgdbRecordDefinition);
try {
Table table = this.tableByCatalogPath.get(catalogPath);
if (table == null) {
table = this.geodatabase.openTable(catalogPath);
if (table != null) {
if (this.tableByCatalogPath.isEmpty()) {
this.geodatabaseReferenceCount++;
}
Maps.addCount(this.tableReferenceCountsByCatalogPath, catalogPath);
this.tableByCatalogPath.put(catalogPath, table);
}
} else {
Maps.addCount(this.tableReferenceCountsByCatalogPath, catalogPath);
}
return table;
} catch (final RuntimeException e) {
throw new RuntimeException("Unable to open table " + catalogPath, e);
}
}
} finally {
releaseGeodatabase();
}
}
}
}
}
use of com.revolsys.gis.esri.gdb.file.capi.swig.Table in project com.revolsys.open by revolsys.
the class FileGdbRecordStore method insertRecord.
@Override
public void insertRecord(final Record record) {
if (record == null) {
} else {
final RecordDefinition recordDefinition = record.getRecordDefinition();
final Table table = getTableWithWriteLock(recordDefinition);
try {
insertRecord(table, record);
} finally {
releaseTableAndWriteLock(recordDefinition);
}
}
}
Aggregations