mirror of
https://github.com/google/nomulus
synced 2026-09-06 08:07:03 +00:00
Maintain only one row in the TmchCrl table at all times (#869)
* Maintain only one row in the TmchCrl table at all times
This commit is contained in:
@@ -77,7 +77,16 @@ public final class TmchCrl extends CrossTldSingleton implements DatastoreEntity,
|
||||
tmchCrl.crl = checkNotNull(crl, "crl");
|
||||
tmchCrl.url = checkNotNull(url, "url");
|
||||
ofyTm().transactNew(() -> ofyTm().putWithoutBackup(tmchCrl));
|
||||
jpaTm().transactNew(() -> jpaTm().putWithoutBackup(tmchCrl));
|
||||
jpaTm()
|
||||
.transactNew(
|
||||
() -> {
|
||||
// Delete the old one and insert the new one
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createQuery("DELETE FROM TmchCrl")
|
||||
.executeUpdate();
|
||||
jpaTm().putWithoutBackup(tmchCrl);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user