I have a problem with my class SessionCanal, when I use in a Web Service the attribute "idSession" is changed when multiple requests come in, I want to know if the Setters and Getters can be thread-safe (synchronized them in some way)
@NoArgsConstructor
public class SesionCanal implements Serializable{
private static final long serialVersionUID = 360569424947712753L;
@Getter @Setter private String idSesion;
}
Thanks for your help.
You can use:
@Getter(onMethod_={@Synchronized}) @Setter(onMethod_={@Synchronized})
private String idSesion;
with Lombok @Synchronized
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With