development icon indicating copy to clipboard operation
development copied to clipboard

cannot (re-) import technical service definition after changing parameter enumeration id

Open ghost opened this issue 9 years ago • 3 comments

[Version] 16.1 GA3, 2016/08/23

[How to reproduce]

  1. create technical service definition with an enumeration parameter (see attachment screen pic below to see the definition, for some reason it changes when I submit the bug and half of it is no longer visible)
  2. as technical provider import service definitions
  3. as supplier create marketable service, with a prices for enumeration parameter options
  4. publish service and customer subscribes to service
  5. terminate subscription
  6. as supplier, deactivate service, delete service
  7. change technical service "option-id1" to "option_id1"
  8. as technical provider, re-import technical service

[Expected result] it is possible to import the technical service . Or if it is not possible (I cannot find a reason for this though), then the error message should be meaningful.

[Observed result] an error occurs at import time: The import failed due to errors in the XML file. Details: Exception thrown from bean. Refer to the Technology Provider's Guide for details on the XML file elements a technical service definition consists of. The problem here is definitely not an error in the xml file (see error log below).

[Detatils] ctmg error log file: Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "parameteroption" violates foreign key constraint "pricedoption_to_parameteroption_fk" on table "pricedoption" Detail: Key (tkey)=(12015) is still referenced from table "pricedoption". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2101) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1834) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:386) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:332) at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:453) at com.sun.proxy.$Proxy233.executeUpdate(Unknown Source) at com.sun.gjc.spi.base.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:125) at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:122) ... 198 more

ghost avatar Sep 14 '16 11:09 ghost

parameter

ghost avatar Sep 14 '16 11:09 ghost

The error message should be changed. We can see that option parameter definition contains the normal parameter id as all other parameter types, and additionally the ids of the options. The ids of options should behave the same as other parameter ids and cannot be changed if already used (e.g in price model). For dispay on UI the localized values are used.

StavrevaS avatar Sep 27 '16 17:09 StavrevaS

I added an additional for existing priced options to avoid this database error message but the problem lies deeper. Since the marketable service is only marked deleted and still has its price model, there is a relation between the options and the price model. This prevents the technical service to be changeable. To resolve this tight coupling, bigger changes are necessary.

MiethanerR avatar Oct 06 '16 09:10 MiethanerR