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

Fix BaseHapiFhirResourceDao $meta method to use HapiTransactionService instead of @Transaction #5896

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
type: fix
issue: 5898
title: "Previous, triggering a GET $meta on a new patient with Megascale configured resulted in a HAPI-0389.
lukedegruchy marked this conversation as resolved.
Show resolved Hide resolved
This has been fixed."
Original file line number Diff line number Diff line change
Expand Up @@ -1410,19 +1410,20 @@ public <MT extends IBaseMetaType> MT metaDeleteOperation(
}

@Override
@Transactional
public <MT extends IBaseMetaType> MT metaGetOperation(Class<MT> theType, IIdType theId, RequestDetails theRequest) {
Set<TagDefinition> tagDefs = new HashSet<>();
BaseHasResource entity = readEntity(theId, theRequest);
for (BaseTag next : entity.getTags()) {
tagDefs.add(next.getTag());
}
MT retVal = toMetaDt(theType, tagDefs);
return myTransactionService.withRequest(theRequest).execute(() -> {
Set<TagDefinition> tagDefs = new HashSet<>();
BaseHasResource entity = readEntity(theId, theRequest);
for (BaseTag next : entity.getTags()) {
tagDefs.add(next.getTag());
}
MT retVal = toMetaDt(theType, tagDefs);

retVal.setLastUpdated(entity.getUpdatedDate());
retVal.setVersionId(Long.toString(entity.getVersion()));
retVal.setLastUpdated(entity.getUpdatedDate());
retVal.setVersionId(Long.toString(entity.getVersion()));

return retVal;
return retVal;
});
}

@Override
Expand Down
Loading