New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove verifyLock() from and add getLockInstance() to VaadinSession #3155
Comments
Originally by @Legioth Reviewed by Henri Sara. |
Originally by archie172 Replying to [#10225 Artur Signell]:
Using what method?? There is no such method in the I'm confused. Both #9996 and #9515 are asking for Vaadin to provide a way to verify that the current thread holds the session lock. But there's still no way to do this using the current API, without casting to ReentrantLock, which is unsafe. Please add |
Originally by @Legioth Replying to archie172:
[[BR]]#9996 explains why Vaadin will not have any API for directly checking the lock: We have planned to improve support for distributed environments in a 7.x.0 release. Such environments might not provide a way of checking whether the lock is held by the current thread e.g. if the locking is based on a shared database or file system. By not providing an API for verifying the lock now, we can avoid breaking that API if we come to realize that it can no longer be supported.
[[BR]]
[[BR]] |
Originally by archie172 OK, thanks. I would just add two more comments:
In any case, I feel this is important because race conditions caused by incorrect locking are very difficult to debug, typically result in corruption of data, and therefore need to be guarded against rigorously (hence #9515). Trust me, this is from lots of prior experience :) |
Originally by @Artur-
Locking of the session should be done using VaadinSession.lock() and VaadinSession.unlock(). These operate on a lock instance available through getLockInstance(). To verify the lock you should use the lock instance and therefore VaadinSession.verifyLock() should be removed
The text was updated successfully, but these errors were encountered: