Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CosmosStoredProcedureRequestOptions. setIfMatchETag(eTag) is not working. #33

Open
SanjayDasTezpur opened this issue Jan 18, 2022 · 0 comments

Comments

@SanjayDasTezpur
Copy link

SanjayDasTezpur commented Jan 18, 2022

if the etag is mismatched, still executes the store proc successfully

`
public void executeStoredProc(Item item) {

CosmosStoredProcedureRequestOptions options = new CosmosStoredProcedureRequestOptions();
options.setIfMatchETag(item.getEtag());
options.setPartitionKey(new PartitionKey(partitionKey));
List<Object> params = Arrays.asList(new ObjectMapper().writeValueAsString(item));
try {
    CosmosStoredProcedureResponse executeResponse = container.getScripts()
            .getStoredProcedure(updateInvstStoredProcId)
            .execute(params, options);
    if (null != executeResponse) {
        return executeResponse.getResponseAsString();
    }
} catch (Exception e) {
    log.error(e);
}

}
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant