on 12-11-2007 3:48 PM
Hello,
I'm developing a RFC-Server with JCo.
I would like to read (only once, at the beginning, when the server starts) the repository information of a function module and save them in a static Repository:
static public class MyRepository extends JCO.BasicRepository
implements IRepository {
public MyRepository(String name) {
super(name);
}
public void FillMyRepository() {
JCO.Client client = null;
JCO.MetaData fmeta = null;
fmeta = (MetaData) this.getFunctionInterface("HU_GET_RFC_DATA");
if ( fmeta == null ) {
IRepository aRepository = null;
try {
client = JCO.createClient(
connClient, // SAP client
connUser, // userid
connPW, // password
connLang, // language
connHost, // host name
connHostSyst ); // System number
client.connect();
aRepository = JCO.createRepository("aRepository", client);
IMetaData fInterface = (IMetaData) aRepository.getFunctionInterface("HU_GET_RFC_DATA").clone();
addFunctionInterfaceToCache( (MetaData) fInterface);
client.disconnect();
} catch (JCO.Exception ex) {
System.out.println("Caught an exception: n" + ex);
}
}
}
}
but then the Server.getFunction doesn't work correctly.
"JCO.Server could not find server function 'HU_GET_RFC_DATA'"
Do you have any idea?
Thanks and regards,
Tommaso
Hi Tommaso,
as far as I know, the moment you create a new Function, it is automatically stored in the Repository.
Every other call to this function ends in this function being retrieved from the JCO Repository. So I think as long as you create only one repository, any Function that you create (Function fx = createFunction("BLAHBLAH");) will be first put into the repository. Which means that only the first call to a Function might take a wee extra than later calls. You don't need to copy a Function into the repository explicitly in my opinion...
Bye,
Sameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.