Overview
The following error is generated when programmatically updating Tags in content via the REST API, using PUT
.
ERROR com.jivesoftware.api.core.jsonrpc.JiveRequestHandlerImpl - An error occured processing an API request: public javax.ws.rs.core.Response com.jivesoftware.api.core.v3.services.content.ContentService.updateContent(java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String,boolean) throws com.jivesoftware.api.core.v3.exceptions.BadRequestException,com.jivesoftware.api.core.v3.exceptions.ConflictException,com.jivesoftware.api.core.v3.exceptions.ForbiddenException: [<CONTENT_CUT>]
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor2706.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.jivesoftware.api.core.jsonrpc.JiveRequestHandlerImpl.execute(JiveRequestHandlerImpl.java:283)
at com.jivesoftware.api.core.jsonrpc.JiveRequestHandlerImpl.handleRequest(JiveRequestHandlerImpl.java:165)
at com.jivesoftware.api.core.jsonrpc.JiveRequestHandlerImpl.put(JiveRequestHandlerImpl.java:240)
Environment
Jive 9.0.3.
Reproduction Steps
- Choose a new tag (i.e. something that does not appear in the autocomplete drop-down list).
- Choose a number of content items to update via the REST API. 10 should be sufficient but it can happen with much less.
PUT
these content items with the updated tags:- Expected Result:
- The expected behavior is that a transaction (not just DB) is 'atomic' meaning that when I
PUT
two simultaneous requests with a new tag, whichever is serviced first 'creates' the tag in the database and whoever is second DOES NOT have to create the tag in the database, but rather use the newly created one.
- The expected behavior is that a transaction (not just DB) is 'atomic' meaning that when I
- Actual Result:
- Multiple requests to
PUT
content with a 'new' tag comes in and Jive updates the database. However, the other 'in-flight' update requests are processed before a cache or index is updated and causes the duplicate unique constraint violation.
- Multiple requests to
- Expected Result:
Root Cause
This is a known software defect: JVHOPST-1196.
Resolution
The customer should upgrade to the latest release (at least 9.0.6) to resolve the issue. If the customer cannot upgrade at this time, they can try the below workarounds:
- Feed all the tags you want to use in the main script to another script or method.
- That new code makes a call to Jive asking "does this tag exist":
- YES: continue.
- NO: Insert tag, WAIT for 1 second.
- Now do your bulk tag update.
OR
- Get a list of all the new tags.
- Go to Jive and create a dummy document.
- Tag it with all the new tags.
Comments
0 comments
Article is closed for comments.