flyrain commented on code in PR #1166:
URL: https://github.com/apache/polaris/pull/1166#discussion_r1996350280
##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java:
##########
@@ -98,26 +99,42 @@ public PolarisEclipseLinkMetaStoreSessionImpl(
@Nullable String confFile,
@Nullable String persistenceUnitName,
@Nonnull PrincipalSecretsGenerator secretsGenerator) {
+ this(
+ createEntityManagerFactory(realmContext, confFile,
persistenceUnitName),
+ store,
+ storageIntegrationProvider,
+ secretsGenerator);
LOGGER.debug(
"Creating EclipseLink Meta Store Session for realm {}",
realmContext.getRealmIdentifier());
- emf = createEntityManagerFactory(realmContext, confFile,
persistenceUnitName);
-
- // init store
- this.store = store;
try (EntityManager session = emf.createEntityManager()) {
this.store.initialize(session);
}
+ }
+
+ private PolarisEclipseLinkMetaStoreSessionImpl(
+ EntityManagerFactory emf,
+ PolarisEclipseLinkStore store,
+ PolarisStorageIntegrationProvider storageIntegrationProvider,
+ PrincipalSecretsGenerator secretsGenerator) {
+ this.emf = emf;
+ this.store = store;
this.storageIntegrationProvider = storageIntegrationProvider;
this.secretsGenerator = secretsGenerator;
}
+ @Override
+ public BasePersistence copyOf() {
+ return new PolarisEclipseLinkMetaStoreSessionImpl(
+ emf, store, storageIntegrationProvider, secretsGenerator);
Review Comment:
What about names like `detach()`, `snapshot()`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]