0 Replies Latest reply on Sep 17, 2010 12:38 PM by marianokm

    Jboss-6-M4 + postgreSQL, hbm2DDL task do not update the database schema ?

    marianokm

      Hi Everyone!

      I've just moved from jboss-5 to jboss-6-M4 for test pruposes.

       

      When i was trying to deploy my ejb3 application, i realized that entity beans mapped against my postgreSQL 8.4 database, where actually created under the "public schema" instead of the "adonis schema" which i'd specified in the proper persistence.xml file.

       

      This never happened before with jboss5 and now, when i deploy my ejb application, all tables (Own's + System ones like timers) are being created within the public schema.

       

      Any clue ?

      Thks in advance

       

      ==================================

      This is my postgreDS configuration

      ==================================

      <?xml version="1.0" encoding="UTF-8"?>

       

      <datasources>

          <local-tx-datasource>

              <jndi-name>DefaultDS</jndi-name>

              <connection-url>jdbc:postgresql://localhost:5432/adonis</connection-url>

              <driver-class>org.postgresql.Driver</driver-class>

              <user-name>adonis</user-name>

              <password>adonis</password>

              <min-pool-size>5</min-pool-size>

              <max-pool-size>20</max-pool-size>

              <metadata>

                  <type-mapping>PostgreSQL 8.0</type-mapping>

              </metadata>

          </local-tx-datasource>

      </datasources>

       

      ========================================

      This is my persistence.xml configuration

      ========================================

      <?xml version="1.0" encoding="UTF-8"?>

       

      <persistence

          version="2.0"

          xmlns="http://java.sun.com/xml/ns/persistence"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

       

          <persistence-unit

              name="adonis">

              <provider>org.hibernate.ejb.HibernatePersistence</provider>

              <jta-data-source>java:/DefaultDS</jta-data-source>

       

              <properties>

                  <property

                      name="hibernate.dialect"

                      value="org.hibernate.dialect.PostgreSQLDialect" />

                  <property

                      name="hibernate.query.substitutions"

                      value="true TRUE, false FALSE" />

                  <property

                      name="hibernate.default_schema"

                      value="adonis" />

                  <property

                      name="hibernate.hbm2ddl.auto"

                      value="update" />

                  <property

                      name="hibernate.show_sql"

                      value="false" />

                  <property

                      name="hibernate.format_sql"

                      value="false" />

                  <property

                      name="hibernate.use_sql_comments"

                      value="false" />

                  <property

                      name="hibernate.order_updates"

                      value="true" />

                  <property

                      name="hibernate.generate_statistics"

                      value="false" />

                  <property

                      name="hibernate.cache.use_second_level_cache"

                      value="true" />

                  <property

                      name="hibernate.cache.use_query_cache"

                      value="false" />

                  <property

                      name="hibernate.cache.region.factory_class"

                      value="org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactory" />

                  <property

                      name="hibernate.cache.region.jbc2.cachefactory"

                      value="java:CacheManager" />

                  <property

                      name="hibernate.cache.region.jbc2.cfg.entity"

                      value="mvcc-entity" />

                  <property

                      name="hibernate.cache.region.jbc2.cfg.query"

                      value="local-query" />

              </properties>

          </persistence-unit>

       

      </persistence>