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

Hudson commented on SYNCOPE-323:
--------------------------------

Integrated in Syncope-trunk #108 (See 
[https://builds.apache.org/job/Syncope-trunk/108/])
    [SYNCOPE-323] Check added in the REST create methods, throwing exception 
mapped to HTTP 409 CONFLICT as suggested (Revision 1449107)

     Result = SUCCESS
ilgrosso : 
Files : 
* 
/syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/utils/RestClientExceptionMapper.java
* 
/syncope/trunk/common/src/main/java/org/apache/syncope/common/types/SyncopeClientExceptionType.java
* 
/syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientCompositeErrorException.java
* 
/syncope/trunk/common/src/main/java/org/apache/syncope/common/validation/SyncopeClientErrorHandler.java
* 
/syncope/trunk/console/src/main/java/org/apache/syncope/console/pages/SchemaModalPage.java
* 
/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ConnInstanceController.java
* 
/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/DerivedSchemaController.java
* 
/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/ResourceController.java
* 
/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/SchemaController.java
* 
/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/VirtualSchemaController.java
* 
/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
* /syncope/trunk/core/src/main/webapp/syncopeClientError.jsp
* 
/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/DerivedSchemaTestITCase.java
* 
/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/ResourceTestITCase.java
* 
/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/SchemaTestITCase.java
* 
/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/VirtualSchemaTestITCase.java

                
> REST: create turns into update for some entities
> ------------------------------------------------
>
>                 Key: SYNCOPE-323
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-323
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0.5, 1.1.0
>            Reporter: Francesco Chicchiriccò
>            Assignee: Francesco Chicchiriccò
>             Fix For: 1.1.0
>
>
> I have recently found that some REST create requests are treated as update.
> For example, try to create a new schema on the admin console and provide a 
> name of another existing schema: you won't get any warning; only, the 
> existing schema definition will be completely replaced by the newly inserted 
> entry.
> After some investigations, I've found that this happens for external 
> resources, schema, derived schema and virtual schema.
> Such entities have in common the fact that the JPA @Id is non-generated.
> The way how saving is handled (via EntityManager#merge()) finally turns an 
> expected create into an update.
> I don't find such behavior as correct, hence I would propose to throw an 
> exception, in the REST create methods for the entities named above, in case 
> the key of the entity being created is already present. 
> [1] http://markmail.org/message/kxrh7pgwuijwyfik

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to