/** * {@inheritDoc} * * This method is overridden in order to flush matches properly before the read. */ @Override protected InterMineObject internalGetObjectById(Integer id, Class<? extends InterMineObject> clazz) throws ObjectStoreException { if (schema.isFlatMode(clazz)) { return super.internalGetObjectById(id, clazz); } Connection c = null; try { c = getConnection(); String readTable = SqlGenerator.tableNameForId(clazz, getSchema()); batch.flush(c, Collections.singleton(readTable)); return internalGetObjectByIdWithConnection(c, id, clazz); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }
/** * {@inheritDoc} * * This method is overridden in order to flush matches properly before the read. */ @Override protected InterMineObject internalGetObjectById(Integer id, Class<? extends InterMineObject> clazz) throws ObjectStoreException { if (schema.isFlatMode(clazz)) { return super.internalGetObjectById(id, clazz); } Connection c = null; try { c = getConnection(); String readTable = SqlGenerator.tableNameForId(clazz, getSchema()); batch.flush(c, Collections.singleton(readTable)); return internalGetObjectByIdWithConnection(c, id, clazz); } catch (SQLException e) { throw new ObjectStoreException("Could not get connection to database", e); } finally { releaseConnection(c); } }