/** * 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); } }