You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airavata.apache.org by "Christie, Marcus Aaron" <ma...@iu.edu> on 2018/02/21 20:16:52 UTC

Re: [airavata] branch registry-refactoring updated: Unique name for registry-refactoring persistence unit

Sachin, Sneha,

Just a heads up that I gave the app catalog persistence unit a unique name in the registry-refactoring module. The reason for this is that the old registry code already has a “appcatalog_data” persistence unit and now that we are using the old registry code and the new registry-refactoring code in the group-based-auth branch, the registry-refactoring code was picking up the old “appcatalog_data” persistence unit.  Hence why I gave it a unique name.

We can come back to this after the registry-refactoring work is finished and when the old registry code is done and change the name back.

> On Feb 21, 2018, at 2:26 PM, machristie@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> machristie pushed a commit to branch registry-refactoring
> in repository https://gitbox.apache.org/repos/asf/airavata.git
> 
> 
> The following commit(s) were added to refs/heads/registry-refactoring by this push:
>     new 1da4d8e  Unique name for registry-refactoring persistence unit
> 1da4d8e is described below
> 
> commit 1da4d8ee4f9483172174093cc73125df3286f4c5
> Author: Marcus Christie <ma...@apache.org>
> AuthorDate: Wed Feb 21 14:26:31 2018 -0500
> 
>    Unique name for registry-refactoring persistence unit
> ---
> .../registry/core/utils/JPAUtil/AppCatalogJPAUtils.java    | 14 +++++++++-----
> .../src/main/resources/META-INF/persistence.xml            |  2 +-
> 2 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/AppCatalogJPAUtils.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/AppCatalogJPAUtils.java
> index c42de64..dad3e43 100644
> --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/AppCatalogJPAUtils.java
> +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/AppCatalogJPAUtils.java
> @@ -2,26 +2,30 @@ package org.apache.airavata.registry.core.utils.JPAUtil;
> 
> import org.apache.airavata.common.exception.ApplicationSettingsException;
> import org.apache.airavata.common.utils.ServerSettings;
> -import org.apache.airavata.registry.core.utils.Committer;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> 
> -import javax.persistence.*;
> +import javax.persistence.EntityManager;
> +import javax.persistence.EntityManagerFactory;
> +import javax.persistence.Persistence;
> +import javax.persistence.PersistenceContext;
> +import javax.persistence.PersistenceUnit;
> import java.util.HashMap;
> import java.util.Map;
> 
> public class AppCatalogJPAUtils {
> 
>     private final static Logger logger = LoggerFactory.getLogger(AppCatalogJPAUtils.class);
> -    private static final String PERSISTENCE_UNIT_NAME = "appcatalog_data";
> +    // TODO: we can rename this back to appcatalog_data once we completely replace the other appcatalog_data persistence context in airavata-registry-core
> +    private static final String PERSISTENCE_UNIT_NAME = "appcatalog_data_new";
>     private static final String APPCATALOG_JDBC_DRIVER = "appcatalog.jdbc.driver";
>     private static final String APPCATALOG_JDBC_URL = "appcatalog.jdbc.url";
>     private static final String APPCATALOG_JDBC_USER = "appcatalog.jdbc.user";
>     private static final String APPCATALOG_JDBC_PWD = "appcatalog.jdbc.password";
>     private static final String APPCATALOG_VALIDATION_QUERY = "appcatalog.validationQuery";
> -    @PersistenceUnit(unitName = "appcatalog_data")
> +    @PersistenceUnit(unitName = PERSISTENCE_UNIT_NAME)
>     protected static EntityManagerFactory factory;
> -    @PersistenceContext(unitName = "appcatalog_data")
> +    @PersistenceContext(unitName = PERSISTENCE_UNIT_NAME)
>     private static EntityManager appCatEntityManager;
> 
>     public static EntityManager getEntityManager() throws ApplicationSettingsException {
> diff --git a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
> index 2d033b7..477122c 100644
> --- a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
> +++ b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
> @@ -20,7 +20,7 @@
>  *
> * -->
> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
> -    <persistence-unit name="appcatalog_data">
> +    <persistence-unit name="appcatalog_data_new">
>         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>         <class>org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity</class>
>         <class>org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity</class>
> 
> -- 
> To stop receiving notification emails like this one, please contact
> machristie@apache.org.