GeoLatte / geolatte-geom

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

Static list of Oracle decoders seems to be the source for multithreading issues #121

Closed kad-kleijm closed 3 years ago

kad-kleijm commented 3 years ago

We run into issues where 2d geometries are being processed by code which expects 3d points (and 3d geometries getting handled by code which expects 2d points). This results in the exception with message "Parameter must be array of length 3" or "Parameter must be array of length 2", thrown by AbstractPositionSequenceBuilder#add(double...).

Our setup:

After examining the geolatte-geom code I observe the static DECODERS list in class org.geolatte.geom.codec.db.oracle.Decoders. It returns (in effect) singleton decoders for decoding geometries. Each decoder extends AbstractSDODecoder which contains a private CoordinateReferenceSystem<?> crs which is not thread safe in this situation. While one thread may use this variable another thread may set this variable to a new value.

This results in the aforementioned exception. Can you verify my findings?

maesenka commented 3 years ago

Resolved by PR #124