*/
@Transactional
protected void initDB() {
if (configs.getPersistenceType() == PersistenceType.IN_MEMORY || dbInitNeeded) {
LOG.info("Database init needed - creating default data");
Users users = injector.getInstance(Users.class);
users.createDefaultRoles();
users.createUser("admin", "admin");
users.createUser("user", "user");
try {
users.promoteToAdmin(users.getLocalUser("admin"));
} catch (AmbariException ignored) {
}
MetainfoEntity schemaVersion = new MetainfoEntity();
schemaVersion.setMetainfoName(Configuration.SERVER_VERSION_KEY);