[CONTROLLER-592] Always get ConflictingModificationException when writing Created: 02/Jul/14 Updated: 25/Jul/23 Due: 18/Jul/14 Resolved: 25/Jul/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | mdsal |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Rob Adams | Assignee: | Tony Tkacik |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| External issue ID: | 1280 |
| Description |
|
I'm trying to write to the operational store from an RPC method. The problem is that even though there's only one write happening anywhere and no deletes, nonetheless I always get back: org.opendaylight.controller.sal.restconf.impl.RestconfDocumentedException: errors: [error-type: application, error-tag: operation-failed, error-message: The operation encountered an unexpected error while executing.error-info: org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException: Node was deleted by other transaction. A slightly simplified version of the code is below. This was working with the old API. Function<RpcResult<TransactionStatus>, RpcResult<Void>> futureTrans = }; public Future<RpcResult<Void>> Endpoint ep = buildEndpoint(input) EndpointKey key = t.put(LogicalDatastoreType.OPERATIONAL, iid, ep); ListenableFuture<RpcResult<TransactionStatus>> r = t.commit(); |
| Comments |
| Comment by Tony Tkacik [ 03/Jul/14 ] |
| Comment by Rob Adams [ 03/Jul/14 ] |
|
I tried with that patch and I still get the same error. |
| Comment by Rob Adams [ 03/Jul/14 ] |
|
It works though when I add: InstanceIdentifier<Endpoints> iid = @Override } @Override }); to my constructor. |
| Comment by Tony Tkacik [ 25/Jul/14 ] |
|
Added methods put and merge which allows you to explicitly state that you want |