I have a servlet that acts as a RMI client that querries a remote RMI
server via a remote method.
The content of this remote method is to parse a hash table and returns part
of it depending on the arguments
passed to this method. This hash table is a class variable into the remote
class.
If the servlet is all alone to querry the remote method , then the response
time is normal.
If this servlet is ran several times in parallel, then the reponse time of
the remote method is much bigger (up to 20 times).
Do you think this is inherent to RMI or is the parsing of the hash table
slown down when it is done in parallel ?
Does anyone have an idea ?
thks/rgds christophe
Extract of the remote method:
public Hashtable getNewObjectStatus(String[] ListOfCustIdNum, String[]
ListOfCustIdAlpha, String basetime) throws RemoteException
{
Hashtable lht = new Hashtable();
int i=0;
Object [] entries ;
String label="";
int lqn=qn;
boolean cust_matches=false;
long t1=new Date().getTime();
// ht is the global hash table
Enumeration names = ht.keys();
int cust_num_len = ListOfCustIdNum.length;
int cust_nam_len = ListOfCustIdAlpha.length;
// loop on main hash table
while (names.hasMoreElements()) {
label=(String)names.nextElement();
entries = (Object [])(ht.get(label));
// for each component, compare customer codes and basetime passed as arg
if (((String)entries[DATE_FIELD]).compareTo(basetime)>0) {
cust_matches=false;
// The status change date is greater than the one passed as arg
for (i=0; i<cust_nam_len;i++)
if (entries[CUST_ALPHA_FIELD].equals(ListOfCustIdAlpha[i]))
cust_matches=true;
if (!cust_matches)
for (i=0; i<cust_num_len;i++)
if (entries[CUST_NUMERIC_FIELD].equals(ListOfCustIdNum[i]))
cust_matches=true;
// if the component belongs to this group of customers, then
// includes it in the hashtable returned.
if (cust_matches==true) {
Object [] OneCompo = {(String)label,
(String)entries[STATUS_FIELD],
(String)entries[DATE_FIELD]
};
lht.put(label,OneCompo);
}
}
}
long t2=new Date().getTime();
return(lht);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists