server: get id from persisted object ReservationVO (#7785)

This commit is contained in:
dahn 2023-07-28 05:16:33 +02:00 committed by GitHub
parent 01e5c25523
commit d958882282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,7 @@ public class CheckedReservation implements AutoCloseable, ResourceReservation {
resourceLimitService.checkResourceLimit(account,resourceType,amount);
ReservationVO reservationVO = new ReservationVO(account.getAccountId(), account.getDomainId(), resourceType, amount);
this.reservation = reservationDao.persist(reservationVO);
CallContext.current().putContextParameter(getContextParameterKey(), reservationVO.getId());
CallContext.current().putContextParameter(getContextParameterKey(), reservation.getId());
} catch (NullPointerException npe) {
throw new CloudRuntimeException("not enough means to check limits", npe);
} finally {