<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_dimension_from_db_by_name(dimension_name):
 """ Gets a dimension from the DB table. """

    try:
        dimension = db.DBSession.query(Dimension).filter(Dimension.name==dimension_name).one()
        return JSONObject(dimension)
    except NoResultFound:
        raise ResourceNotFoundError("Dimension %s not found"%(dimension_name))