on 09-04-2023 10:39 AM
I am currently writing an application with sap cap which firstly fetches Role collections from the BTP and then inserts them in a Hana Cloud DB when it receives a request via API.
In my local development environment where I use sqlite, everything works fine. However, when I push the code to CF and use Hana Cloud I get the following error: "Error: Transaction is rolled back, no subsequent .run allowed, without prior .begin"
The code looks as follows (Peusdo code)
const response = await fetch('Role-Collections-From-BTP-URL')
const roleCollections = await response.json()
await Promise.all(roleCollections.map(async (role) => {
const newRC = await addAdditionalInfoToRC(role)
await srv.create(RoleCollections).entries(newRC) //Here the error appears
})
...
async function addAdditionalInfoToRC(role) {
const azureGroupDetails = await srv.read(AzureGroups).where(ID: ID)
role.azure = azureGroupDetails
return role
}
I have another serivce endpoint where I think I do the same and there it also works for Hana, but here it does not work. In this endpoint I also fetch something and then insert it into the hana via a map function.
I have tried googling the error, but have not found anything similar.
Did anyone else face the same issue or knows how to fix it?
Thank you very much !
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.