cancel
Showing results for 
Search instead for 
Did you mean: 

Java objects and threads inside NW clustering

ashish_bansal
Explorer
0 Kudos

Hi Experts,

I would basically like to how servlets and threads get initialized inside Java Clustering envt. In our case it is NW VM clustering.

We have one customer who has 1 central instance and 2 application servers (Virtual Machine) and 1 DB server. The central system and the other 2 VM share this same DB.

I understand that they do deployment on only the central server and then the other servers gets syncronised from the file system.

My question is when the application is deployed (or started) how the servlets are initilized on these 3 servers. are they initilized separately for all the three or their is only one instance of the servlet and then it is shared among all 3.

Next point is if i am scheduling/creating a java timer thread inside the init() method of the servlet does this timer thread gets created in all of them individually or only 1.

Do the servers in the clustering envt have their own Java objects or do they share the Java objects?

The problem one of our customer is facing is that they have this kind of clustering envt and the thread sometimes runs in all the servers and sometimes only in one. Could you please help me in understanding the root cause?? Thanks a lot for your help.

Regards,

Ashish

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Ashish Bansal wrote:

My question is when the application is deployed (or started) how the servlets are initilized on these 3 servers. are they initilized separately for all the three or their is only one instance of the servlet and then it is shared among all 3.

The J2EE Engine HTTP Provider Service running on the dispatcher performs heterogeneous load balancing for Web applications. It is an important function when you run distributed applications in a cluster environment. It gives you the opportunity to run an application on a few cluster nodes, and you can always be sure that the client request to that application is dispatched to the correct server where the application is available (from official SAP documentation).

ashish_bansal
Explorer
0 Kudos

Hi Roman,

Thanks for the information but in our scenario we do not depend on HTTP requests coming from client. As i mentioned before some threads are created inside the servlets init() method (which usually gets called during the application start on the server) but those threads should only be created in 1 server and not all, because they are getting the data from backend through RFC call and then inserting it to NW DB. So when there is only 1 DB and threads are running in all the servers it will have multiple, unnecessary (and maybe also incorrect) data. Thanks.

Regards,

Ashish

0 Kudos

May be you can try   logon groups , so that all the requests are sent to only one application server

http://help.sap.com/saphelp_nw73/helpdata/en/4a/93c8ceedaa388fe10000000a42189c/content.htm

keep only one server node for that application server

If you want to solve this programmatically then

I think in each server node , the applications exist (its servlet and everything associated with it)

This document talks about clustering..May be you get more details here how to deal programatically

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e10b4b78-0801-0010-aaba-fb0a5f9c7...

Former Member
0 Kudos

Hi Ashish,

What is the NW version that you are working on?

Have you checked the default_trace and log files of affected app servers to find any related error messages?

Do you get any error messages on the portal UI for this issue?

For NW 710 and higher versions all Java applications are stored in database only, so no matter how many app servers or clusters you have, all instances will access the same application version from the database.

Your problem in this case could be more of a connectivity issue.

If you have NW version which stores applications on file system then I am not sure how to solve this until you share some related logs and trace files.

-roshan

ashish_bansal
Explorer
0 Kudos

Hi Roshan,

Thanks for taking out some time to read through our issue. The NW version our customer is using is 7.0. When i checked the logs last time with another colleague i could see that the threads were running individually on all the servers and that was the issue basically but i would again check the log files to get some more details.

And do you know in NW 7.0 how the java objects are handled? If they would have their own JVM then i would assume that they will have their own java objects? and in that case servlets would get initialized individually in each server?

Thanks again,

Ashish