add db dialect and fix global resource access