private void updateMetaAndFirstLevelChildren(ServerSession session, DbObject obj) { List<DbObject> list = obj.getChildren(); Comment comment = findComment(obj); if (comment != null) { DbException.throwInternalError(); } updateMeta(session, obj); // remember that this scans only one level deep! if (list != null) { for (DbObject o : list) { if (o.getCreateSQL() != null) { updateMeta(session, o); } } } }
/** * Remove the object from the database. * * @param session the session * @param obj the object to remove */ public void removeDatabaseObject(ServerSession session, DbObject obj) { checkWritingAllowed(); String objName = obj.getName(); DbObjectType type = obj.getType(); synchronized (getLock(type)) { Map<String, DbObject> map = getMap(type); if (SysProperties.CHECK && !map.containsKey(objName)) { DbException.throwInternalError("not found: " + objName); } Comment comment = findComment(obj); // lockMeta(session); if (comment != null) { removeDatabaseObject(session, comment); } int id = obj.getId(); obj.removeChildrenAndResources(session); map.remove(objName); removeMeta(session, id); } }
Comment comment = findComment(obj); if (comment != null) { removeDatabaseObject(session, comment);
db.updateMeta(session, object); } else { Comment comment = db.findComment(object); if (comment == null) { if (text == null) {