[ 
https://issues.apache.org/jira/browse/UNOMI-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15339430#comment-15339430
 ] 

Serge Huber edited comment on UNOMI-32 at 6/20/16 12:46 PM:
------------------------------------------------------------

Another way of implementing this would be to have the ProfileService.save 
method fail if an entry already exists, in a way similar to what databases do 
with INSERT statements.

But this doesn't remove the requirement to perform a merge on the POST endpoint.


was (Author: shuber):
Another way of implementing this would be to have the ProfileService.save 
method fail if an entry already exists, in a way similar to what databases do 
with INSERT statements.

> Profile POST REST call overwrites existing profile in storage
> -------------------------------------------------------------
>
>                 Key: UNOMI-32
>                 URL: https://issues.apache.org/jira/browse/UNOMI-32
>             Project: Apache Unomi
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0.0-incubating, 1.0.1-incubating
>            Reporter: Serge Huber
>             Fix For: 1.0.1-incubating
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Currently, if we receive a POST request on the ProfileServiceEndPoint.save 
> method, we will directly save the content in ElasticSearch. The problem is 
> that ES by default will always replace any existing entry, meaning that if it 
> contained data that was not sent in the POST request then we will loose 
> profile data.
> We need to define whether it is the responsibility of the endpoint or the 
> ProfileService to check for existing data and merging it, but since we 
> already have update methods in the back-end it seems to me that the save 
> method could overwrite existing data and that the endpoint could take care of 
> the needed logic of merging, but this is open for discussion here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to