GeoLatte / geolatte-geom

A geometry model that conforms to the OGC Simple Features for SQL specification.
Other
132 stars 63 forks source link

Fix thread safety issues in a multi threaded environment. #124

Closed kad-kleijm closed 3 years ago

kad-kleijm commented 3 years ago

Fix for https://github.com/GeoLatte/geolatte-geom/issues/121

I tried to reason why you would want to use a static list of decoders. I don't think it's for performance reasons right? To mitigate the multithreading issue I moved away from static/singleton decoders and replaced it with an enum factory.

maesenka commented 3 years ago

You're right, it wasn't performance.

I lost sight of the fact that decoders usually aren't thread-safe, and was meant to create a static list of decoderfactories.

You're fix is elegant, so I will merge immediately.

kad-kleijm commented 3 years ago

We've created a 1.4.1 version (based on tag v1.4.0) and deployed it in our repository. We use hibernate-spatial 5.4.27 so geolatte-geom 1.4.1 is compatible with this version.

We've been testing the fix extensively and haven't been able to reproduce the exception we've been experiencing before. I'll share our findings after we've been running this fix in production for some time.

kad-kleijm commented 3 years ago

Fyi, we've been running in production with this fix for some time now and haven't had exceptions thus far.