Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Intermitttently applet performance is slow

 
Sirish Kumar Gongal Reddy
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

We have One IBM web sphere app server5.0.2 with 2 deployed on processors and 8 GB ram system and three instances are running on this server. All the instances are connected to separate DB instances.


Application: whenever the page loads the applet is downloading on the page (which contains half part is jsp and half part is applet as shown in the below screen)
Here my problem is whenever the page loading more than five users applet loading is very slow compare to accessing two or three users.

Note: Whatever the applet I am talking is actuate spread sheet engines (Product from actuate company) we can implement excel like functionalities using this api.

I looked into different parts of code and found some places where it was taking time
1) Whenever the java script is trying to download actuate product jar
2) Creating jbook object on applet class INIT() method.

I would like to explain you my simple architecture of loading applet, at this situation the involved files are jsp, JavaScript, applet class, servlet class

In the Jsp

<html>
<body leftmargin=0 topmargin=0 scroll=no>
<script src="<%=RBCConstants.APP_JSP_PATH%>/javascript/load_BPapplet.js"></script>
</body>
</html>


In the load_BPapplet.js Java Script // This part is taking time

document.write('<OBJECT classid = "clsid:CAFEEFAC-0014-0002-0010-ABCDEFFEDCBA" codebase ="/RockWorld/Download_jre/j2re-1_4_2_10-windows-i586-p.exe" NAME = "FrontEndApplet" WIDTH ="100%" HEIGHT ="70.5%" > ');
document.write('<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">');
document.write('<PARAM NAME="scriptable" VALUE="false">');
document.write('<PARAM NAME = CODEBASE VALUE ="/RockWorld/AssortPlan">');
document.write('<PARAM NAME = CODE VALUE = "com/imageinfo/common/FrontEndApplet.class" >');
document.write('<PARAM NAME = ARCHIVE VALUE = "f1j11swing.jar" >'); // this jar placed in the same folder where jsp and JavaScript files are placed
document.write('<PARAM NAME = NAME VALUE = "f1" >');
document.write('<PARAM NAME = workbook VALUE = "InlineNewWkOrderDtl"> </OBJECT> ');

In the FrontEndApplet applet class (Attached for reference)
I have added the new method called destroy as below, this method is executing automatically by IE whenever the user leaves the applet, but still the performance looks same as existing.

public void destroy() {
System.out.println("**destroy method:");
if (m_jBook != null){
System.out.println("**destroy method: if executed");
m_jBook.destroy();
}
}

As per current implementation in the INIT () method
Step 1: creating jbook object (which is used in entire class, this object is also used after the applet is loaded for other functionalities like ActionListener,
HyperlinkListener, KeyListener, UpdateListener, MouseListener
Step 2: Add jbook object to required listeners
Step 3: Preparing URL connection to make call to servlet. (Servlet functionalities are mentioned below)
Step 4: Calculating formulas

In the Servlet Class (Attached for reference)

if (szAction.equals("GETEXCEL"))
{
con = RequestDBConnection();
BookModelImpl book = null;
ExcelDataObject ExcelObject = null;
String eviewId;
String escreenName;
String etokenValue;
String esessionId;
String sheetName;
try {
HttpSession session = req.getSession(true);
ExcelObject = (ExcelDataObject) session.getValue("dataEcel");
eviewId = ExcelObject.getViewId();
eowner = ExcelObject.getOwner();
eNumber = ExcelObject.getNumber();
escreenName = ExcelObject.getScreenName();
etokenValue = ExcelObject.getTokenValue();
esessionId = ExcelObject.getSessionId();
sheetName = ExcelObject.getSheetName();
BuildPlanExcel bex = new BuildPlanExcel();
book = bex.buildPlanExcel(con, eviewId, eowner, eNumber,
escreenName, etokenValue, esessionId, sheetName); // This Class is used To set required data on sheet
by executing database queries
hmSTDRvMap = bex.getLocMap();
session.setAttribute("FormMap", hmSTDRvMap);
ServletOutputStream out = res.getOutputStream();
//writes out the book to an excel file
WriteParams wp = new WriteParams();
wp.setFileType(BookModelImpl.eFileCurrentFormat);
book.write(out, wp);
out.close();
} catch (com.f1j.util.F1Exception f1j) {
f1j.printStackTrace();
} catch (java.io.IOException ioe) {
ioe.printStackTrace();
} finally {
book.releaseLock();
book.destroy();
try {
if (con != null) {
ReleaseDBConnection(con);
}
} catch (Exception e) {
}
}
}


Please review and advice, this is a production problem, I really appreciate all your efforts.



Thanks & Regards
Gopi
[ August 02, 2007: Message edited by: Bear Bibeault ]
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you ascertained that the problem is really the download of the applet? I think it's much more likely that the bottleneck is on the server, if the servlet is hit by multiple simultaneous requests. Download static files for the applet shouldn't cause the server any problems. Does the servlet do something time-consuming, or does it do something that causes the requests to become synchronized or serialized?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic