• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Replication  RSS feed

 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application has two Application servers, App1 and App2..

we are using weblogic 8.1 Application server

There is session replication done in weblogic.xml file .

<session-descriptor>
<session-param>
<param-name>InvalidationIntervalSecs</param-name>
<param-value>1</param-value>
</session-param>

<session-param>
<param-name>PersistentStoreType</param-name>
<param-value>replicated</param-value>
</session-param>


The application works fine but currently there is data getting replicated among different users.

Is it the problem of session data getting merged with other session data
or is it server cache not getting cleared or is there any setting to be changed in weblogic application server??

or is there any other problem ???

Kindly reply with solution...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it very likely that somewhere you are improperly using an instance variable that can be "seen" by all request threads for user data.

Bill
 
Prince Manchanda
Ranch Hand
Posts: 52
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post some examples of the data that is getting replicated.

The application works fine but currently there is data getting replicated among different users.


Also, would recommend that you check for static variables in your Servlet. They are known to create problems, in my experience.
 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your valuable responses.

# The values are private variables and they are accessed using setter getter.

and then

req.setAttribute(private variable)
req.getAttribute()

is used.


# Instance or static variables are not used, meaning value to the variables is not directly assigned.


Merging is such

First entry :100000739222|643990|171.00|

Second entry : 100000739222|643991|113.00| ....... wrong entry

100000739222 is a unique entry and should had not been duplicated.. ideally.

100000739223|643991|337.0| .... should had been the right entry.


first entry got merged to some other entry.


#Is it session data getting merged??

Is there any solution for it...

Please reply.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you should show us the code?
 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just observed this in the code..

private HttpServletRequest req;
private HttpServletResponse res;


public void doPost(HttpServletRequest req, HttpServletResponse res)
throws java.io.IOException, ServletException {
try {
this.req = req;
this.res = res;
}

Is this instance variables?

if it is a instance variable, then can you tell me how does instance variables affect in the session replication?

and what is the solution for it?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, req and res are instance variables. But it makes no sense to store references to those objects - what are you trying to achieve by that?
 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its an old code developed by someone using weblogic 8.1.

The instance variable is used to keep the variable accessible outside the post method. So that the same variable can be used in other methods too.

How does instance variable affect in session replication? just trying to understand it..

please help.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no direct connection between session replication and instance variables. Stuff like servlet requests/responses can't be replicated, though (they're not serializable), but that's OK because it makes no sense to put those in the session anyway.
 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a common problem existing in weblogic 8.1?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In any servlet container you should not be using servlet instance variables.
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any instance variables defined in Servlet shall be shared by all threads. Any servlet container share same Servlet object across all threads. Threads keep its value on Stck but Servlet is stored in Heap. So means that instance variables of Servlet are seen by all threads using that servlet. In your case, probability is that one thread has assigned that unique id but that thread was not able to complete it work as OS system has deferred that thread execution and started another new thread. That new thread used same unique ID.
 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you everyone for your valuable inputs.
 
Annamaria Joseph
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instance variable must be a reason.

But we have deployed a patch provided by Weblogic for Weblogic 8.1 and the problem is currently solved.

Thank you each and everyone..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!