3 Replies Latest reply on May 14, 2012 11:35 PM by freemarket

    Has anyone successfully used Forge to persist data in PostgreSQL back end with AS7 server

    tonykaska

      I tried using Forge to setup persistence using Postgres as the backend database. The command is successful. However the application still uses the ExampleDS data source and the H2 database. Persistence.xml also referring to ExampleDS only. I am wondering how to make it use the Postgres database. Please see below for what I am trying. Thank you.

       

      test $ persistence setup --provider HIBERNATE --container JBOSS_AS7 --

      database POSTGRES

      ***INFO*** Setting transaction-type="JTA"

      ***INFO*** Using example data source [java:jboss/datasources/ExampleDS]

      ? The JPA provider [HIBERNATE], also supplies extended APIs. Install these as w

      ell? [y/N] Y

      Install which version of [org.hibernate:hibernate-entitymanager:::]?

       

       

        1 - [org.hibernate:hibernate-entitymanager:::3.3.1.ga]*

        2 - [org.hibernate:hibernate-entitymanager:::3.3.2.Beta1]*

        3 - [org.hibernate:hibernate-entitymanager:::3.3.2.GA]*

        4 - [org.hibernate:hibernate-entitymanager:::3.4.0.CR1]*

        5 - [org.hibernate:hibernate-entitymanager:::3.4.0.CR2]*

        6 - [org.hibernate:hibernate-entitymanager:::3.4.0.GA]*

        7 - [org.hibernate:hibernate-entitymanager:::3.5.0-Beta-2]*

        8 - [org.hibernate:hibernate-entitymanager:::3.5.0-Beta-3]*

        9 - [org.hibernate:hibernate-entitymanager:::3.5.0-Beta-4]*

        10 - [org.hibernate:hibernate-entitymanager:::3.5.0-CR-1]*

        11 - [org.hibernate:hibernate-entitymanager:::3.5.0-CR-2]*

        12 - [org.hibernate:hibernate-entitymanager:::3.5.0.Beta-1]*

        13 - [org.hibernate:hibernate-entitymanager:::3.5.0-Final]*

        14 - [org.hibernate:hibernate-entitymanager:::3.5.1-Final]*

        15 - [org.hibernate:hibernate-entitymanager:::3.5.2-Final]*

        16 - [org.hibernate:hibernate-entitymanager:::3.5.3-Final]*

        17 - [org.hibernate:hibernate-entitymanager:::3.5.4-Final]*

        18 - [org.hibernate:hibernate-entitymanager:::3.5.5-Final]*

        19 - [org.hibernate:hibernate-entitymanager:::3.5.6-Final]*

        20 - [org.hibernate:hibernate-entitymanager:::3.6.0.Beta1]*

        21 - [org.hibernate:hibernate-entitymanager:::3.6.0.Beta2]*

        22 - [org.hibernate:hibernate-entitymanager:::3.6.0.Beta3]*

        23 - [org.hibernate:hibernate-entitymanager:::3.6.0.Beta4]*

        24 - [org.hibernate:hibernate-entitymanager:::3.6.0.CR1]*

        25 - [org.hibernate:hibernate-entitymanager:::3.6.0.CR2]*

        26 - [org.hibernate:hibernate-entitymanager:::3.6.0.Final]*

        27 - [org.hibernate:hibernate-entitymanager:::3.6.1.Final]*

        28 - [org.hibernate:hibernate-entitymanager:::3.6.2.Final]*

        29 - [org.hibernate:hibernate-entitymanager:::3.6.3-SNAPSHOT]*

        30 - [org.hibernate:hibernate-entitymanager:::3.6.3.Final]*

        31 - [org.hibernate:hibernate-entitymanager:::3.6.4-SNAPSHOT]*

        32 - [org.hibernate:hibernate-entitymanager:::3.6.4.Final]*

        33 - [org.hibernate:hibernate-entitymanager:::3.6.5-SNAPSHOT]*

        34 - [org.hibernate:hibernate-entitymanager:::3.6.5.Final]*

        35 - [org.hibernate:hibernate-entitymanager:::3.6.6-SNAPSHOT]*

        36 - [org.hibernate:hibernate-entitymanager:::3.6.6.Final]*

        37 - [org.hibernate:hibernate-entitymanager:::3.6.7-SNAPSHOT]*

        38 - [org.hibernate:hibernate-entitymanager:::3.6.7.Final]*

        39 - [org.hibernate:hibernate-entitymanager:::3.6.8-SNAPSHOT]*

        40 - [org.hibernate:hibernate-entitymanager:::3.6.8.Final]*

        41 - [org.hibernate:hibernate-entitymanager:::3.6.9-SNAPSHOT]*

        42 - [org.hibernate:hibernate-entitymanager:::3.6.9.Final]*

        43 - [org.hibernate:hibernate-entitymanager:::3.6.10-SNAPSHOT]*

        44 - [org.hibernate:hibernate-entitymanager:::3.6.10.Final]*

        45 - [org.hibernate:hibernate-entitymanager:::3.6.11-SNAPSHOT]*

        46 - [org.hibernate:hibernate-entitymanager:::4.0.0-SNAPSHOT]*

        47 - [org.hibernate:hibernate-entitymanager:::4.0.0.Alpha1]*

        48 - [org.hibernate:hibernate-entitymanager:::4.0.0.Alpha2]*

        49 - [org.hibernate:hibernate-entitymanager:::4.0.0.Alpha3]*

        50 - [org.hibernate:hibernate-entitymanager:::4.0.0.Beta1]*

        51 - [org.hibernate:hibernate-entitymanager:::4.0.0.Beta2]*

        52 - [org.hibernate:hibernate-entitymanager:::4.0.0.Beta3]*

        53 - [org.hibernate:hibernate-entitymanager:::4.0.0.Beta4]*

        54 - [org.hibernate:hibernate-entitymanager:::4.0.0.Beta5]*

        55 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR1]*

        56 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR2]*

        57 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR3]*

        58 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR4]*

        59 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR5]*

        60 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR6]*

        61 - [org.hibernate:hibernate-entitymanager:::4.0.0.CR7]*

        62 - [org.hibernate:hibernate-entitymanager:::4.0.0.Final]*

        63 - [org.hibernate:hibernate-entitymanager:::4.0.1-SNAPSHOT]*

        64 - [org.hibernate:hibernate-entitymanager:::4.0.1.Final]*

        65 - [org.hibernate:hibernate-entitymanager:::4.1.0-SNAPSHOT]*

        66 - [org.hibernate:hibernate-entitymanager:::4.1.0.Final]*

        67 - [org.hibernate:hibernate-entitymanager:::4.1.1-SNAPSHOT]*

        68 - [org.hibernate:hibernate-entitymanager:::4.1.1.Final]*

        69 - [org.hibernate:hibernate-entitymanager:::4.1.2]*

        70 - [org.hibernate:hibernate-entitymanager:::4.1.3-SNAPSHOT]*

        71 - [org.hibernate:hibernate-entitymanager:::4.1.3.Final]*

        72 - [org.hibernate:hibernate-entitymanager:::4.1.4-SNAPSHOT]*

       

       

      ? Choose an option by typing the number of the selection [*-default]  [0] 72

      ***SUCCESS*** Persistence (JPA) is installed.

        • 1. Re: Has anyone successfully used Forge to persist data in PostgreSQL back end with AS7 server
          ctomc

          Hi,

           

          configure/add datasource and give it a name you like.

          then open persistence.xml and change the jta-data-source to point to your new datasource.

           

           

          --

          tomaz

          • 2. Re: Has anyone successfully used Forge to persist data in PostgreSQL back end with AS7 server
            lincolnthree

            Hi Tomaz,

             

            As I said on the email thread:

             

            In order to use the PostgreSQL database, you'll need to skip the --container JBOSS_AS7 parameter. This will override the datasource configuration as you probably saw in the INFO messages:

             

             

             

            ***INFO*** Setting transaction-type="JTA"

             

            ***INFO*** Using example data source [java:jboss/datasources/ExampleDS]

            We should probably make this more clear, or perhaps create a warning or error scenario instead of INFO. When you remove the --container parameter, do you get a better result?

             

            You may need to use some of the extended parameters like --jndiName and so forth, depending on how your database data source is set up.

             

            Hope this helps! Please keep us informed if you run in to additional problems. And thanks for mentioning it - we'll try to make this experience more straightforward.

             

            ~Lincoln

             

            I've opened this issue: https://issues.jboss.org/browse/FORGE-565

            • 3. Re: Has anyone successfully used Forge to persist data in PostgreSQL back end with AS7 server
              freemarket

              Hi Lincoln,

               

              I believe this issue exists for Oracle persistence as well:

               

              [forge1] forge1 $ persistence setup --provider HIBERNATE --database ORACLE_10G --jdbcURL jdbc:oracle:thin://bssssss:1521:prod --jdbcUsername fxxxxxxxx --jdbcPassword yyyyyyyy --jdbcDriver oracle.jdbc.OracleDriver

              ? [container=ARG (of type org.jboss.forge.spec.javaee.jpa.api.JPAContainer)]:

              ? [container=ARG (of type org.jboss.forge.spec.javaee.jpa.api.JPAContainer)]:

               

              where forge insisted on a container type though I explicitly omitted it.

               

              I can tweak the persistence.xml as per above using the values produced by the solder maven archetype as my prototype.

               

              Henry