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
Provides a default listener when no listener is set #3658
base: master
Are you sure you want to change the base?
Conversation
…rs to know the exact event source
@@ -1831,7 +1834,7 @@ public void setEventListenerClass(String className) { | |||
if (cipher != null) { | |||
url += ";CIPHER=" + cipher; | |||
} | |||
eventListener.init(url); | |||
eventListener.init(url, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method Database.setEventListenerClass(...)
reads without synchronization from this.eventListener
. Potentially races with write in method Database.removeSession(...)
.
Reporting because another access to the same memory occurs on a background thread, although this access may not.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
|
Sorry, I think we cannot accept this pull request due to following reasons:
Clustering code in H2 was written a long time ago, and, unfortunately, it is implemented in a simple and naive way with significant design flaws. Here you're trying to work around some problem in it, but it will be far better to improve the implementation itself. Please, describe your problem in a new issue, maybe there are better options for its resolution. |
Thank you very much for your quick feedback. I can understand what you said. It's necessary for the long-term development of the product and should not affect other people who are using it. I have a point. On the server side, it provides EventListener class that also runs on the server, but cannot be configured by itself. |
You could start the database server from code e.g. Or we could extend Then your clients can just connect to the server using a URL without any parameters. |
Provides a default listener when no listener is set. And add parameters to know the exact event source.
Sometimes we need to manage and monitor the database as a server and adjust the database parameters when it happens.
For example, deleteFilesOnDisconnect is automatically set to true on the target node when the cluster is created. This can easily trigger the deletion of data files when the database is closed, resulting in the loss of data files and tables. We can correct the parameters through the listener