You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juddi.apache.org by "Ashley (JIRA)" <ju...@ws.apache.org> on 2011/08/19 08:03:27 UTC

[jira] [Created] (JUDDI-517) Externalising Persistence Properties

Externalising Persistence Properties
------------------------------------

                 Key: JUDDI-517
                 URL: https://issues.apache.org/jira/browse/JUDDI-517
             Project: jUDDI
          Issue Type: Improvement
          Components: core
    Affects Versions: 3.0.4
         Environment: Websphere App Server 7 and DB2 DB
            Reporter: Ashley
            Assignee: Kurt T Stam


Properties of Persistence xml needs to be externalized.

Changes with need to be done
1) org.apache.juddi.config.Property.java
      public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
      public final static String DATASOURCE                                   ="hibernate.connection.datasource";
      public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
      public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
      public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";

2) org.apache.juddi.config.AppConfig.java

      private void loadConfiguration() throws ConfigurationException
      {
            ....
            if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
                  properties = new HashMap<String, String>();
                properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
                  properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
                  properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
                properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
            }
            ....
      }

 
3) org.apache.juddi.config. PersistenceManager.java

protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
            try {
if (emf == null ){
                        if(properties != null){
                           emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
                     }else{
                              emf = Persistence.createEntityManagerFactory(persistenceUnitName);
                        }
                  }

            }
}

 




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092808#comment-13092808 ] 

Kurt T Stam commented on JUDDI-517:
-----------------------------------

OK I understand your request, but the juddi properties are in the war as well. So how is it different from setting these properties in the peristence.xml?

--Kurt

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JUDDI-517) Externalising Persistence Properties

Posted by "Ashley (JIRA)" <ju...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13097761#comment-13097761 ] 

Ashley commented on JUDDI-517:
------------------------------

Hi Kurt,

Sorry for the late reply, juddi properties is externalized ie. if you give the path of juddi.properties in the JVM args, juddi.properties will not be picked up from the WAR.

following is a code snippet from appconfig.java 
private void loadConfiguration() throws ConfigurationException
      {
            //Properties from system properties
            CompositeConfiguration compositeConfig = new CompositeConfiguration();
            compositeConfig.addConfiguration(new SystemConfiguration());
            //Properties from file
            PropertiesConfiguration propConfig = null;
              final String filename = System.getProperty("juddi.propertiesFile");
            if (filename != null)
            {
                  propConfig = new PropertiesConfiguration(filename);
            } else {
                  propConfig = new PropertiesConfiguration(JUDDI_PROPERTIES);
            }


> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam updated JUDDI-517:
------------------------------

    Fix Version/s: 3.1.2

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.1, 3.1.2
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam updated JUDDI-517:
------------------------------

    Fix Version/s:     (was: 3.1.1)

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.2
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam reopened JUDDI-517:
-------------------------------


OK, yeah we will have to add that to the documentation. I will reopen this jira, so we can do that for 3.1.2.

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.1
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam closed JUDDI-517.
-----------------------------

    Resolution: Fixed

More or less followed the code changes proposed. Should work now.

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.1
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam updated JUDDI-517:
------------------------------

    Fix Version/s: 3.1.2

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.2
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam updated JUDDI-517:
------------------------------

    Fix Version/s:     (was: 3.1.2)
                   3.1.1

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.1
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JUDDI-517) Externalising Persistence Properties

Posted by "Ashley (JIRA)" <ju...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13105226#comment-13105226 ] 

Ashley commented on JUDDI-517:
------------------------------

Hi Kurt,
 Thanks alot for the update.

I did miss out on this Juddiv3.properties changes.Sorry for the same.

--------------------Juddiv3.properties----------------------------------------------------------------------------------------------

persistenceProvider=Hibernate
hibernate.connection.datasource=java:/jdbc/JuddiDS               (in case datasource name needs to be changed)
hibernate.hbm2ddl.auto=update
hibernate.default_schema=JuddiSchema                                (in case Schema name needs to be changed)
hibernate.dialect=org.hibernate.dialect.DB2Dialect                   (in case DB is different )
---------------------------------------------------------------------------------------------------------------------------------------------------


> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.1
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13099006#comment-13099006 ] 

Kurt T Stam commented on JUDDI-517:
-----------------------------------

OK that seems like a good addition. 

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.2
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (Closed) (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam closed JUDDI-517.
-----------------------------

    Resolution: Fixed

Added documentation to the database setup chapter
                
> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>             Fix For: 3.1.2
>
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (JUDDI-517) Externalising Persistence Properties

Posted by "Kurt T Stam (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kurt T Stam closed JUDDI-517.
-----------------------------

    Resolution: Not A Problem

Hi Ashley,

These properties can be set in the persistence.xml. I hope this covers your needs. Please reopen if it does not.

Cheers,

--Kurt

> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (JUDDI-517) Externalising Persistence Properties

Posted by "Ashley (JIRA)" <ju...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashley reopened JUDDI-517:
--------------------------


Yes Kurt i am aware that these properties can be set in persistence.xml...had mentioned that in the problem description before.

The problem is persistence.xml is part of the WAR.A WAR is a deliverable which should typically not be modified after delivery, at client location.
Properties like datasource name etc should be modifiable after delivery by the client.
EntityManager has two constructors, JUDDI is using the single parameter one, requesting you to use the two parameter one, which also takes persistence properties as an argument.


> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String, String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira