-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33663/#review82150
-----------------------------------------------------------
-1 I still this think is a problem. Consider the following existing code:
```
// For each of the hosts, add a host version
for (HostEntity host : hostEntities) {
HostVersionEntity hostVersionEntity = new HostVersionEntity(host,
helper.getOrCreateRepositoryVersion(HDP_22_STACK, "2.2.0.1-996"),
RepositoryVersionState.INSTALLED);
hostVersionDAO.create(hostVersionEntity);
}
```
The entities are already being persisted. By added CascadeType.PERSIST,
exceptions will be thrown if the entity already exists. If CascadeType.PERSIST
is going to be used, then we need to ensure it's not created anywhere else.
- Jonathan Hurley
On April 29, 2015, 3:33 a.m., Dmitro Lisnichenko wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33663/
> -----------------------------------------------------------
>
> (Updated April 29, 2015, 3:33 a.m.)
>
>
> Review request for Ambari, Alejandro Fernandez, Jonathan Hurley, and Nate
> Cole.
>
>
> Bugs: AMBARI-10818
> https://issues.apache.org/jira/browse/AMBARI-10818
>
>
> Repository: ambari
>
>
> Description
> -------
>
> After installing the package, noticed that there is a button for "re-install"
> so just clicked on it.
>
>
> Diffs
> -----
>
>
> ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostEntity.java
> 9f3f70c
>
> Diff: https://reviews.apache.org/r/33663/diff/
>
>
> Testing
> -------
>
> Manual verification - retrying distribute bits multiple times
> Bug is intermittent, so not 100% sure
>
>
> Thanks,
>
> Dmitro Lisnichenko
>
>