telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
65 stars 105 forks source link

[cygnus-ngsi][NGSIPostgreSQLSink] Data insertion fails when cache is not enabled #1446

Open frbattid opened 7 years ago

frbattid commented 7 years ago

This is because at PostgreSQLBackendImpl.java PostgreSQLCache cache is initialized to null upon declaration:

https://github.com/telefonicaid/fiware-cygnus/blob/master/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/postgresql/PostgreSQLBackendImpl.java#L45

Then, only if enable_cache is set to true, cache is initialized with a PostgreSQLCache object:

https://github.com/telefonicaid/fiware-cygnus/blob/master/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/postgresql/PostgreSQLBackendImpl.java#L58

If not, the data insertion fails when checking if the schema is in the cache:

https://github.com/telefonicaid/fiware-cygnus/blob/master/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/postgresql/PostgreSQLBackendImpl.java#L86

PedroD commented 6 years ago

This issue remains unfixed.