Sathvathsan Sampath

Ranch Hand
+ Follow
since Oct 03, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sathvathsan Sampath

One more thing to watch out if your web application is marked distributable - containers might not do any change detection to servlet static variables and might not propagate that across a cluster. In such a case the change in value is seen in only one of the servers in cluster. In such case you might want to consider putting shared data in httpSession.
But please do make sure you consult your container documentation to understand how the change detection and propagation takes place.
19 years ago
I don�t think the static variable would be transferred. Or can�t think how that could possibly happen.
So if I understand you correctly, your question is now about replication of data in your cluster. Two things here -
1) Check if your application server provides session data replication as part of their clustering support.
2) If you require the data stored in static variables elsewhere in your code transferred then that data needs to be part of the session so that the container can help you with replication.

If you think from a container point of view I am not sure how the container can possibly know which application data needs to be replicated outside your session (for example). I don't know what application server you are using. However, weblogic does something like this -
Data in web tier that you want to be replicated should be bound to the httpsession. Weblogic has hooks that listen when an attribute is bound or modified (session.setAttribute etc). When such events occur weblogic understands which session attributes changed/bound and then replicates the entire object graph associated only for the delta in httpsession. Therefore, one consequence of this is, if you have an object that was already bound to the session in your previous request and you made changes to that object in subsequent request then you need to explicity invoke the setAttribute() in your code. Doing so will fire the weblogic listeners attached to this event and weblogic will understand that the object graph associated with the associated session attribute needs to be replicated. This replication happens to a secondary server before the response is served at the end of http request.
Otherwise, I am not sure how application servers can figure out what are the objects that requires replication unless we communicate that somehow.
[ October 24, 2005: Message edited by: Sathvathsan Sampath ]
19 years ago
Ab parashar - Please read by private message to you.
Apologies to others - please ignore this.
19 years ago
I have a secure and insecure web application. The secure one deals with payment/billing services for a user while the other deals with browsing catalogs etc. The user experience should be seamless as he browses non-secure and secure parts of the application. Both applications are served from the same domain and need to use cookies.

In order to ensure security the cookies (from each application) should not be scoped just at the domain level but rather scoped to an application level within a domain. How do I do this? Do I need to check with my container if it offers anything on this? Thoughts..?
How did others here deal when they had secure and insecure parts of application using cookies?
19 years ago

By Ronald Heukers
Can somebody explain me what happens exactly when you use static variables in classes (called by servlets) that are running in an environment with loadbalancing.


Can you elaborate your question? Do you mean what happens at the time of fail-over?

But what happens when there is session transfering.


Again, are you asking what happens during session replication under a clustered environment?
19 years ago

By Ben Souther
What was his reaction to your answer?


He responded asking, �Besides a shut down or freeing memory resources when exactly would the container destroy a servlet?�
He wanted me to be very specific and detailed. I didn't have a clue. He believed I just scratched the surface saying the above. When I asked him what his response would be to this he refused to answer! I want to understand how more there is to this.
19 years ago
I was faced with this question and answered it saying whenever the servlet container deemed necessary - during shutdown or when it needs to free memory resources. However, the interviewer wasn't not satisfied with this response.
Thoughts...?
19 years ago

Smita Chopra: Anyways when he asked me at the end of the interview if I had any questions I told him he was very rude and I would not like to work for a company where people like him existed.



Excellent !
And, HCL is definitely not a company to work for going by their work culture. They are such a put off during interviews.
19 years ago
A. Patel,
I feel the salary offered is quite high given your background. Why don't you give us more details as what the role demands of you? Is this position on contract or a permanent one?
19 years ago
In many of my interviews, some of the things the interviewers seemed to concentrate were:
a) Java skills
b) Problem solving ability by asking me solve some puzzles or asking me write algorithms for some complex problems
c) Popular designs patterns and some OO stuff.
I find many people being able pull these off (depending on the interviewer) with some reading, aptitude and experience to some extent.
However, what they don't seem to really assess is how effectively one writes code? Once hired as a developer his primarily task would be to cut code and he could do a pathetic job violating standard programming practices.

1) To avoid this why not ask for a sample or illustration of previous work? This is not to ask the candidate to show actual code written for his present or previous company.
2) Give the candidate a typical problem that reflects closely the job would involve. Give some time and ask him to present his code at a later date. This will tell a whole lot about him.
3) If the job involves bug-fixing lot of time, why not give him buggy code and ask him to fix it.
This might involve some effort on the interviewer but would really help the team in the longer run. Thoughts, opinions�?
19 years ago
1) Declare constants inside class
class Constants
{
public static final SOME_CONSTANT = "someVal";
}

2) Or inside an interface
interface Constants
{
public static final SOME_CONSTANT = "someVal";
}

I tend to prefer (2) as I can let my client class implement this. This makes my code less verbose that Constants.SOME_CONSTANT. Thoughts, opinions?
[ June 10, 2005: Message edited by: Sathvathsan Sampath ]
I forgot to mention that the interviewer had mentioned that he asks these questions to women candidates. Isn't that discriminating?
19 years ago
This shocking experience happened to my wife yesterday and the day before. She is into public relations and was interviewing with an IT company here at Bangalore for marketing commutations position. I don't want to name the company. All I can say is this company struck an alliance with one of the biggest US based IT company that is into everything you can imagine. That company acquired their personal computing/hardware division recently. They have operations worldwide, china being their primary headquarters. The interviewers (two men of Indian origin) fired questions like this midway during interview:

1) Are you married or single?
2) Do you have kids? If no, when do intend to have kids and what are your plans?
3) Will you have kids soon after joining us?
4) Will you be able to put in long hours of work regularly? He said, "I have a kid and a wife. I work the least here. I come into office by 9am and work till 11pm here regularly! Can you show such commitment?"
The interviewer commented they were equal opportunity employers. He wanted to make informed decision and that was why he was seeking answers to such questions! My wife was grilled with the same set of questions in both the round of interviews. However, they seemed very convinced with her abilities and believed she had what it takes to do the job well. However, she strongly feels her marital status and sex seemed to be thier biggest issue!

I view this totally discriminating and the questions to be illegal .
1) Has other women ranchers here at India or elsewhere in the world faced a similar situation? How did you deal with it?
2) If you are an employee, you can seek help with appropriate department within the company. What do you do when you are not on board and this happens during interview?
3) Can you ask the interviewer to ask such questions in writing and then approach his company's legal/ethics department? I don't think he would be willing though.

[ June 09, 2005: Message edited by: Sathvathsan Sampath ]

[ June 09, 2005: Message edited by: Sathvathsan Sampath ]
[ June 09, 2005: Message edited by: Sathvathsan Sampath ]
19 years ago
This might not answer your question - did you consider jmx to manage your resources?
[ June 08, 2005: Message edited by: Sathvathsan Sampath ]

By Sonny Gill
Yes, there are typical workflows from the starting page, but the user can choose to not complete the steps and return to any page up in the hierarchy at any time through a menu bar that always shows where the user currently is, and provides link to all parent pages.



I am guessing that you might have a lightweight workflow manager that is aware of whether the user discarded at some point in the workflow or not. Your session could have values keyed against a workflow. When he jumps out of it to another one, the workflow manager could detect this and perform some life cycle management operations.
I'd first profile to gather data on performance to prove any speculation and weigh other relevant contraints.