Added filter by state for tables. Fixed a problem in lifecycle for database views.