on 02-15-2007 12:00 PM
Hi
I am trying to run the following code which bombs out with the message <i>The MDM repository is invalid.</i> when <i>repositorySessionCmd.execute();</i> is called. Any help greatly appreciated. Here is the code:
public void createRepositorySession(RepositoryIdentifier repId) {
CreateRepositorySessionCommand repositorySessionCmd =
new CreateRepositorySessionCommand(this.pool);
repositorySessionCmd.setRepositoryIdentifier(repId);
try {
trace.debugT("executing RepositorySessionCommand with rep id "{0}" ...",
new Object[]{repId.getName()});
repositorySessionCmd.execute();
trace.debugT("Execution of RepositorySessionCommand successful.");
} catch (CommandException e) {
String errMsg = "Could not create a repository session for rep id: " +
repId.getName();
trace.traceThrowableT(Severity.ERROR, errMsg, e);
throw new RuntimeException(errMsg, e);
}
with RepositoryIdentifier being:
RepositoryIdentifier repId = new RepositoryIdentifier(
"DOL",
"127.0.0.1",
"MS_SQL");
Thanks
Paul
You have to use static constant to specify the type of database server.
import com.sap.mdm.server.DBMSType;
public static RepositoryIdentifier getRepositoryIdentifier(){
return new RepositoryIdentifier("Ads", "fsclxthiagaa", <b>DBMSType.MS_SQL</b>);
}
Message was edited by:
Adhappan Thiagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
Thanks for the detailed response to my query. I could solve that problem.
Thanks,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
I have specified the fully qualified name of the MDM server, MDM repository and the static DBMSType but still I am getting the "Invalid MDM Repository". Could you tell me what else you did to make your application work ?
Thanks in advance..
Regards,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guru
These are the utility methods I am using:
static ConnectionAccessor getConnection() throws ConnectionException {
ConnectionAccessor connection = null;
connection = ConnectionPoolFactory.getInstance(props.getProperty("serverTag"));
return connection;
}
static private RepositoryIdentifier getRepositoryIdentifier() {
return new RepositoryIdentifier(props.getProperty("repositoryName"), props.getProperty("serverTag"), DBMSType.MS_SQL);
}
static private String getRepositorySessionTag(ConnectionAccessor connection) throws CommandException {
String repositorySessionTag = null;
CreateRepositorySessionCommand cmd = new CreateRepositorySessionCommand(connection);
RepositoryIdentifier repID = getRepositoryIdentifier();
cmd.setRepositoryIdentifier(repID);
cmd.execute();
repositorySessionTag = cmd.getRepositorySession();
return repositorySessionTag;
}
Where (in my case) <b>props.getProperty("serverTag")</b> = JNBN11039415A (ie fully qualified server name) and <b>props.getProperty("repositoryName")</b> = DOL (ie the value in the "Name" field under "Repository Detail" in MDM Console.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.