Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

DTO's are common for many users?

Tomasz Fruba
6 years ago Sep 16, 2015 12:26pm
Thomas Mattsson
6 years ago Sep 16, 2015 1:16pm

Most likely you are using a static keyword somewhere. In Vaadin, since everything is serverside, the usage of static is strongly discouraged, because that object will be shared with all user. This results in exactly the kind of issue you are experiencing.

Use normal objects without static and you should be fine. If you need to store the object somewhere, the UI class is a good place to start; you can get a reference to the UI object that is currently active with UI.getCurrent(). Cast the result to YourUIClass, and you can access anything you have stored in it. This also ensures proper garbage collection once the user logs out and the UI object is destroyed.

Tomasz Fruba
6 years ago Sep 22, 2015 9:58am
Thomas Mattsson
6 years ago Sep 22, 2015 10:05am
Tomasz Fruba
6 years ago Sep 22, 2015 10:14am
Thomas Mattsson
6 years ago Sep 22, 2015 10:15am
Jon Inazio Sánchez Martínez
6 years ago Sep 22, 2015 10:28am
Tomasz Fruba
6 years ago Sep 23, 2015 7:39am
Jon Inazio Sánchez Martínez
6 years ago Sep 23, 2015 12:05pm