Session management and questions

Hi,

I have a Vaadin application that is embedded in another web application. The two applications run on two different servers, etc. The Vaadin application is launched when the user presses a tab on the host application’s frame. Parameters are passed into the application identifying the customer that is connecting, etc. All works well, except if they navigate back to the Vaadin application multiple times.

It appears as though information is being cached by the browser, so even though the host application may have changed customers, data gets defaulted certain text fields from the previous customers.

How can we force the Vaadin application to always get a new session when starting so the information is not “cached” and repopulates the textfields?

Occasionally, we get the tomcat error below. I am also guessing that this is a session issue? Can you please confirm and let me know if there is anything we can do to avoid this issue?

Thanks for your help.

Tom
12002.png

It is difficult to answer with so little information but I will still try.

You tomcat error show that somewhere in you code (in method activated ACHPasswordManager) you are calling :

someWindow.addWindow(someOtherWindow)

The error is telling you that “someOtherWindow” was actually already added before.
Is that window a brand new component or is this object instance kept in a field (static or not) and is actually used twice ?

For the problem of having the customers sharing data, you should check :

  • that each customer get a different application instance
  • that there is no possible way of having 2 users share the same instance of some form, window, component, … (a static field in some instance, if the application object is shared you need to check anything you put in the session, or the application instance)
  • if you have overriden the Application.getWindow() function make sure that the right window is served to the right client

I hope this will guide you in the right direction for solving your problem

Thanks for the suggestions.

I’ve looked through my code and none of my windows are declared as static. I use the AppFoundation addon along with Navigator. So all of these windows are declared like:


public class ACHPasswordView extends AbstractView<AbsoluteLayout>

In my main application module, I do the following:



ViewHandler.addView(ACHPasswordMediator.class, this);
....

@Override
public void activate(View view) {
	if (currentView == null) {
		mainLayout.addComponent((Component) view);
	} else {
		// Activate the view by replacing the current view with the given
		// view in
		// the main layout
		mainLayout.replaceComponent(currentView, (Component) view);
	}
	currentView = (AbstractView<?>) view;
}


For the problem of having the customers sharing data, you should check :
- that each customer get a different application instance

How is it possible that a more than one user would get the same application instance?

Thanks for your help.

Tom

Unfortunately I don’t use any of those plugins so I don’t know what is happening behind the scenes.

But the tomcat error is not bound to the Views but with Widows.
ACHPasswordManager.activated is within your code and it seems it is using a window (as in com.vaadin.ui.Window)
That window is being reused. Not the view.

Applications are bound to the browser which has created it. We had a problem with some proxy and decided to tunel all calls to vaddin. Vaddin got all the packets as being from the same source (the tunnel) and so was serving the same instance to all the users. This may happen with other setups, I am just speculating.

Also even with different Application, the same view (actually same data in different view instances) might be served to several users depending on how your plugins are managin persistence and getting data back.

In the first time, I think you should focus on what is happening inside your ACHPasswordManager code. anything which is opening subwindows or windows or tabs or poups and try to understand why you are adding the same (window, subwindow, popup, …) twice. This may giv you some idea as to your data leaks.

Thanks for your help. Your answers have pointed me in the right direction and I know exactly where to look.

Tom