public void create(final Iterable<M> entities, final InternalCallContext context) throws U { final List<M> refreshedEntities = transactionalSqlDao.execute(false, targetExceptionClass, getCreateEntitySqlDaoTransactionWrapper(entities, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks for (M refreshedEntity : refreshedEntities) { transactionalSqlDao.populateCaches(refreshedEntity); } }
@Override public void create(final M entity, final InternalCallContext context) throws U { final M refreshedEntity = transactionalSqlDao.execute(false, targetExceptionClass, getCreateEntitySqlDaoTransactionWrapper(entity, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks transactionalSqlDao.populateCaches(refreshedEntity); }
@Override public void create(final AccountModelDao entity, final InternalCallContext context) throws AccountApiException { // We don't enforce the created_date for the Account because it is extracted from context // so, if there is no referenceTime specified we have to set it from the InternalCallContext#created_date // if (entity.getReferenceTime() == null) { entity.setReferenceTime(context.getCreatedDate()); } final AccountModelDao refreshedEntity = transactionalSqlDao.execute(false, getCreateEntitySqlDaoTransactionWrapper(entity, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks transactionalSqlDao.populateCaches(refreshedEntity); // Eagerly populate the account-immutable cache as well accountImmutableCacheController.putIfAbsent(refreshedEntity.getRecordId(), new DefaultImmutableAccountData(refreshedEntity)); }
public void create(final Iterable<M> entities, final InternalCallContext context) throws U { final List<M> refreshedEntities = transactionalSqlDao.execute(false, targetExceptionClass, getCreateEntitySqlDaoTransactionWrapper(entities, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks for (M refreshedEntity : refreshedEntities) { transactionalSqlDao.populateCaches(refreshedEntity); } }
@Override public void create(final M entity, final InternalCallContext context) throws U { final M refreshedEntity = transactionalSqlDao.execute(false, targetExceptionClass, getCreateEntitySqlDaoTransactionWrapper(entity, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks transactionalSqlDao.populateCaches(refreshedEntity); }
@Override public void create(final AccountModelDao entity, final InternalCallContext context) throws AccountApiException { // We don't enforce the created_date for the Account because it is extracted from context // so, if there is no referenceTime specified we have to set it from the InternalCallContext#created_date // if (entity.getReferenceTime() == null) { entity.setReferenceTime(context.getCreatedDate()); } final AccountModelDao refreshedEntity = transactionalSqlDao.execute(false, getCreateEntitySqlDaoTransactionWrapper(entity, context)); // Populate the caches only after the transaction has been committed, in case of rollbacks transactionalSqlDao.populateCaches(refreshedEntity); // Eagerly populate the account-immutable cache as well accountImmutableCacheController.putIfAbsent(refreshedEntity.getRecordId(), new DefaultImmutableAccountData(refreshedEntity)); }