@Override protected Set<Long> doInBackground() throws Exception { Set<Long> newSelection; // Get all primary value where default geometry intersects a bounding box try (Connection connection = SFSUtilities.wrapConnection(activeLayer.getDataManager().getDataSource().getConnection())) { String geomFieldName = SFSUtilities.getGeometryFields(connection, TableLocation.parse(activeLayer.getTableReference())).get(0); newSelection = ReadTable.getTablePkByEnvelope(mc.getDataManager(), activeLayer.getTableReference(), geomFieldName, selectionRect, !intersects); } catch (SQLException e) { automaton.transition(Code.NO_SELECTION); throw new TransitionException(e); } return newSelection; }