You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Xinran Tinney (JIRA)" <ji...@apache.org> on 2018/04/16 15:52:00 UTC
[jira] [Assigned] (SENTRY-2200) Update Sentry datanucleus config
names
[ https://issues.apache.org/jira/browse/SENTRY-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xinran Tinney reassigned SENTRY-2200:
-------------------------------------
Assignee: Xinran Tinney
> Update Sentry datanucleus config names
> --------------------------------------
>
> Key: SENTRY-2200
> URL: https://issues.apache.org/jira/browse/SENTRY-2200
> Project: Sentry
> Issue Type: Bug
> Components: Sentry
> Affects Versions: 2.1.0
> Reporter: Na Li
> Assignee: Xinran Tinney
> Priority: Major
>
> Since 2.0, the datanucleus version in Sentry changed from 3.2 to 4.1.
> Based on the datanucleus documentation following config names are renamed. Sentry has several places use those configuration names. We should update the config names to reflect the correct names.
> {noformat}
> Migration from 3.3.7 to 4.0.0.M1
> Migrating will require the following changes
> Persistence property datanucleus.allowAttachOfTransient now defaults to true for JPA usage; set it explicitly to get old behaviour
> Persistence property datanucleus.metadata.validate was removed (replaced by datanucleus.metadata.xml.validate some time back)
> Persistence property datanucleus.defaultInheritanceStrategy is renamed to datanucleus.metadata.defaultInheritanceStrategy
> Persistence property datanucleus.autoCreateSchema is renamed to datanucleus.schema.autoCreateAll
> Persistence property datanucleus.autoCreateTables is renamed to datanucleus.schema.autoCreateTables
> Persistence property datanucleus.autoCreateColumns is renamed to datanucleus.schema.autoCreateColumns
> Persistence property datanucleus.autoCreateConstraints is renamed to datanucleus.schema.autoCreateConstraints
> Persistence property datanucleus.validateSchema is renamed to datanucleus.schema.validateAll
> Persistence property datanucleus.validateTables is renamed to datanucleus.schema.validateTables
> Persistence property datanucleus.validateColumns is renamed to datanucleus.schema.validateColumns
> Persistence property datanucleus.validateConstraints is renamed to datanucleus.schema.validateConstraints
> Persistence property datanucleus.fixedDatastore is now removed, since it only equated to setting the "autoCreate" properties to false.{noformat}
> One example in SentryStore
> {code}
> public SentryStore(Configuration conf) throws Exception {
> this.conf = conf;
> Properties prop = getDataNucleusProperties(conf);
> boolean checkSchemaVersion = conf.get(
> ServerConfig.SENTRY_VERIFY_SCHEM_VERSION,
> ServerConfig.SENTRY_VERIFY_SCHEM_VERSION_DEFAULT).equalsIgnoreCase(
> "true");
> if (!checkSchemaVersion) {
> prop.setProperty("datanucleus.autoCreateSchema", "true");
> prop.setProperty("datanucleus.fixedDatastore", "false");
> }
> {code}
> In ServiceConstants
> {code}
> public static final ImmutableMap<String, String> SENTRY_STORE_DEFAULTS =
> ImmutableMap.<String, String>builder()
> .put("datanucleus.connectionPoolingType", "BoneCP")
> .put("datanucleus.validateTables", "false")
> .put("datanucleus.validateColumns", "false")
> .put("datanucleus.validateConstraints", "false")
> .put("datanucleus.storeManagerType", "rdbms")
> .put("datanucleus.autoCreateSchema", "false")
> .put("datanucleus.fixedDatastore", "true")
> .put("datanucleus.autoStartMechanismMode", "checked")
> .put(DATANUCLEUS_ISOLATION_LEVEL, DATANUCLEUS_REPEATABLE_READ)
> .put("datanucleus.cache.level2", "false")
> .put("datanucleus.cache.level2.type", "none")
> .put("datanucleus.query.sql.allowAll", "true")
> .put("datanucleus.identifierFactory", "datanucleus1")
> .put("datanucleus.rdbms.useLegacyNativeValueStrategy", "true")
> .put("datanucleus.plugin.pluginRegistryBundleCheck", "LOG")
> .put("javax.jdo.PersistenceManagerFactoryClass",
> "org.datanucleus.api.jdo.JDOPersistenceManagerFactory")
> .put("javax.jdo.option.DetachAllOnCommit", "true")
> .put("javax.jdo.option.NonTransactionalRead", "false")
> .put("javax.jdo.option.NonTransactionalWrite", "false")
> .put("javax.jdo.option.Multithreaded", "true")
> .build();
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)