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

Mockexam question regarding jsp embedded with business logc

 
Dannyf Soon
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

The question that is from Sun ePractice for SCEA is as below:

Your organization has developed a new J2EE Invoicing system, and during load testing the system runs slow, but CPU and memory utilization remain low. To save time they embedded all the business logic into the JSPs as scriptlets.

What could be a cause of the problem?
A You need to scale your application horizontally.
B You need to scale your application vertically.
C Servlet instances are getting locked for every request.
D You are dropping database connections.
E Your load balancer needs to be re-polarized.

C is correct answer. But I don't get what its explanation is saying about:

Option C is correct because the default behavior for JSPs is for the service method to be synchronized in the resulting servlet.

I understand that:

JSP will be compiled to class by container in deployment time and will be running as servlet. Its service method by default is multiple-threading. Synchronizing service method will cause sequential processing of requests, thereby impacting performance negtively.

But in the scenario of mockquestion, it's not said that the service method is synchronized.

Please help to explain in details. Thanks in advance!


Regards,

Danny
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Very poorly framed question and the answer is also incorrect. The answer seems to suggest that by default only one user can access a JSP page at any given time. Unless the question also mentioned the isThreadSafe flag and setting it, I do not understand how the answer can be correct.

[EDIT]

It is mandatory to mention the source of all questions. Do update us about where you found this.

Also welcome to javaranch
 
Dannyf Soon
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:

Very poorly framed question and the answer is also incorrect. The answer seems to suggest that by default only one user can access a JSP page at any given time. Unless the question also mentioned the isThreadSafe flag and setting it, I do not understand how the answer can be correct.

[EDIT]

It is mandatory to mention the source of all questions. Do update us about where you found this.

Also welcome to javaranch


Thanks!

Just added that the source is Sun ePractice for SCEA.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic