[hibernate-issues] [JIRA] (HHH-13879) Slow query log should use System#nanoTime not System#currentTimeMillis
Sanne Grinovero (JIRA)
jira at hibernate.atlassian.net
Tue Feb 25 15:10:38 EST 2020
Sanne Grinovero ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A99e61e65-956b-4a21-b29c-06057642e9ea ) *commented* on HHH-13879 ( https://hibernate.atlassian.net/browse/HHH-13879?atlOrigin=eyJpIjoiMWU0N2VkODNiNmIzNGE5OGE2NGM0OWJiMzZhMTE5MmMiLCJwIjoiaiJ9 )
Re: Slow query log should use System#nanoTime not System#currentTimeMillis ( https://hibernate.atlassian.net/browse/HHH-13879?atlOrigin=eyJpIjoiMWU0N2VkODNiNmIzNGE5OGE2NGM0OWJiMzZhMTE5MmMiLCJwIjoiaiJ9 )
no worries Vlad, I’m not expressing a concern over your patch. Just pointing out that it’s not straight forward - as I said in my first sentence.
Regarding monotonic clocks - that’s precisely the problem, neither {{ currentTimeMillis }} nor {{ nanoTime }} guarantee that. It doesn’t matter that the OS supports it, the JDK is not exposing the same counter - however what it exactly does depends on the version of the JVM, its vendor, and the OS.
I’m aware of NTP issues - it’s probably better to stick with nanoTime for short durations - just worth keeping in mind that even so, it’s not bulletproof.
( https://hibernate.atlassian.net/browse/HHH-13879#add-comment?atlOrigin=eyJpIjoiMWU0N2VkODNiNmIzNGE5OGE2NGM0OWJiMzZhMTE5MmMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13879#add-comment?atlOrigin=eyJpIjoiMWU0N2VkODNiNmIzNGE5OGE2NGM0OWJiMzZhMTE5MmMiLCJwIjoiaiJ9 )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121- sha1:a269fed )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200225/718a0293/attachment.html
More information about the hibernate-issues
mailing list