use of org.pentaho.di.repository.kdr.delegates.metastore.KettleDatabaseRepositoryMetaStore in project pentaho-kettle by pentaho.
the class KettleDatabaseRepository method connect.
/**
* Connect to the repository.
*
* @throws KettleException
* in case there is a general unexpected error or if we're already connected
*/
public void connect(String username, String password, boolean upgrade) throws KettleException {
// first disconnect if already connected
connectionDelegate.connect(upgrade, upgrade);
try {
IUser userinfo = userDelegate.loadUserInfo(new UserInfo(), username, password);
securityProvider = new KettleDatabaseRepositorySecurityProvider(this, repositoryMeta, userinfo);
// We need to add services in the list in the order of dependencies
registerRepositoryService(RepositorySecurityProvider.class, securityProvider);
registerRepositoryService(RepositorySecurityManager.class, securityProvider);
// Apparently, MySQL InnoDB opens a new transaction simply by doing a
// lookup.
//
connectionDelegate.closeReadTransaction();
// Open the metaStore for business too...
//
metaStore = new KettleDatabaseRepositoryMetaStore(this);
} catch (KettleDatabaseException e) {
// if we fail to log in, disconnect and then rethrow the exception
connectionDelegate.disconnect();
throw e;
}
}
Aggregations