9 Replies Latest reply on Jun 28, 2006 2:01 PM by alex.pinkin

    JBINSTALL-49, DataSource configuration

    starksm64

      Certainly one of the biggest issues is changing from the default database due to non-portal DDL. Changing the DefaultDS name to something else requires and even larger number of changes so what we need to define is the scope of this issue.

      For the first implementation of this feature, all I want to see is the ability to change the DefaultDS binding to another database. Issues with this include:

      1. Where is the jdbc driver coming from? In general we cannot bundle these due to license issues. We could bundle OS license versions like TDS, MySQL, Postgres. Otherwise, it could be selected by the user or just left as a todo.
      2. How to obtain the correct configuration information for the DataSource? This is a function of the driver and DataSource type. This relates to the management view discussion occuring between Charles and myself as part of the ProfileService, but that won't be available for this issue.
      3. How to obtain DataSource specific configuration like DDL? Ideally I would like to use Hibernate configuration facilities to avoid shipping database specific DDL.

        • 1. Re: JBINSTALL-49, DataSource configuration
          sebersole

          I think I am missing some context or discussion behind this...

          1) So the overall feature being requested is the ability to specify the database to be used by default in JBAS install performed through the installer? If the list of available database to choose from here is finite, could you not just plugin in wizards based on the db selected to walk through additonal config? Sorry, not really sure how the installer works overall...
          2) DDL for what exactly?

          • 2. Re: JBINSTALL-49, DataSource configuration
            jimm

            >2) DDL for what exactly?

            deploy/jms/hsqldb-jdbc-state-service.xml
            deploy/jms/hsqldb-jdbc2-service.xml
            deploy/uuid-key-generator.sar/META-INF/jboss-service.xml

            • 3. Re: JBINSTALL-49, DataSource configuration
              sebersole

              The JMS stuff is easy enough; we'll just need to provide the appropriate Hibernate metadata. I assume the JDBC types are consistent between the different databases schemas?

              I would need someone to explain to me in more detail the purpose of the two services in the key generator deployment in terms of what they expect in the database. Or point me to the appropriate src location for the source code.

              • 4. Re: JBINSTALL-49, DataSource configuration
                jimm

                See http://fisheye.jboss.com/viewrep/JBoss/jboss/src/main/org/jboss/ejb/plugins/keygenerator/hilo/HiLoKeyGenerator.java
                The ddl is only used for the HiLoKeyGenerator Service.

                The service is just a utility for getting unique ids. There are no AS dependencies on this service. Maybe it should just be reimplemented with Hibernate generators?

                • 5. Re: JBINSTALL-49, DataSource configuration
                  jimm

                  Also, I don't know what has to be done for the new Messaging stuff.

                  • 6. Re: JBINSTALL-49, DataSource configuration

                    1) Installer currently doesn't allow to configure datasource. I agree that we should stick with just configuring DefaultDS for now. It would be nice to keep it simple though and avoid creating DB-specific configuration panels. Why don't we just allow user to select DB type, enter connection-url, username and password, as well as XA flag? Customers can update other DS parameters after the install by hand.

                    As far as including 3rd party JDBC drivers, we should probably do it for the most popular OS databases.

                    • 7. Re: JBINSTALL-49, DataSource configuration
                      amit.bhayani

                      I was thinking on how Installer can make life easy by featuring the custom datasource configuration. Instead of having a hsqldb-ds Pack, I was thinking on having a config-datasource pack and a UserInput Panel which will ask user to enter

                      DataSource JNDI Name
                      Local or XA
                      Connection URL
                      driver-class
                      user-name
                      password
                      etc etc fields of ds

                      and having a vm template to create a full fledge *-ds.xml file.

                      I can use the JNDI name entered by user to be replaced in *-service.xml files used for JMS. Also to have exploded uuid-key-generator.sar so that I can easily replace the Datasource JNDI name in jboss-service.xml

                      This will give us atleast the start but there are few gray areas like
                      1) How do I force user to add the driver .jar files? May be I can just have a TODO and note to user to copy it manually
                      2) For different database we have different DDL in PersistenceManager for JMS and other files. How do I select the appropriate one depending on what database user is using?

                      Scott can you please elaborate on how we can make use of Hibernate here?

                      • 8. Re: JBINSTALL-49, DataSource configuration
                        sebersole

                        The thought was to no longer maintain such DDL scripts, but to use Hibernate to generate the DDL in the database-independent way that it does.

                        • 9. Re: JBINSTALL-49, DataSource configuration

                          (1): imho it's ok to just notify user that JDBC driver needs to be copied manually to /server/default/lib. Later we can implement a custom panel which allows user to select a JDBC driver and then copies it over.

                          As far as exposing datasource type specific parameters in the installer, I would postpone this. First we should implement common parameters like connection-url, name, password, xa.