| .. | .. |
|---|
| 420 | 420 | if (lic.getFullName() == null || "".equals(lic.getFullName())) { |
|---|
| 421 | 421 | lic.setFullName(nameOrReference); |
|---|
| 422 | 422 | } |
|---|
| 423 | | - em.persist(lic); |
|---|
| 423 | + if (lic.getId() != null) { |
|---|
| 424 | + em.merge(lic); |
|---|
| 425 | + } else { |
|---|
| 426 | + em.persist(lic); |
|---|
| 427 | + } |
|---|
| 424 | 428 | em.persist(licenseHelper.createLicenseHistoryAction(lic, user, LicenseHistory.Actions.CREATE)); |
|---|
| 425 | 429 | if (lic.getActivationCode() != null) { |
|---|
| 426 | 430 | em.persist(licenseHelper.createLicenseHistoryAction(lic, user, LicenseHistory.Actions.ACTIVATE, "Activated by code on creation")); |
|---|