5 Replies Latest reply on Jul 7, 2006 2:44 PM by weston.price

    Retry: JBoss AS/Firebird: Hibernate Dialect must be explicit

    knaveofhearts

      Sorry about the previous message. Here it is using "code" rather than "quote". I discovered the Preview button, so it is now readable.

      I am trying to get JBoss to run the most simple Titan example (4.1) in Burke & Monson-Haefel, Enterprise Java Beans 3.0 using Firebird 1.5. The JBoss version is 4.0.4.GA.

      Any help would be appreciated in addressing the following problem:

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:jar=titan.jar,unitName=titan
       State: FAILED
       Reason: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: Firebird 1.5>LI-V1.5.3.4870 Firebird 1.5/tcp (mulder.vorticityCorp.com)/P10
       I Depend On:
       jboss.jca:service=ManagedConnectionFactory,name=FIrebirdDS
       Depends On Me:
       jboss.j2ee:jar=titan.jar,name=TravelAgentBean,service=EJB3
      


      The persistence.xml file:
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence>
       <persistence-unit name="titan">
       <jta-data-source>java:/FirebirdDS</jta-data-source>
       <properties>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       </properties>
       </persistence-unit>
      </persistence>
      


      The titandb-ds.xml file:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <connection-factories>
      
       <mbean code="org.firebirdsql.management.FBManager" name="jboss.jca:service=FirebirdManager">
       <attribute name="FileName">/vc/db/firebird/titan.fdb</attribute>
       <attribute name="UserName">jboss</attribute>
       <attribute name="Password">XXX</attribute>
       <attribute name="CreateOnStart">true</attribute>
       <attribute name="DropOnStop">false</attribute>
       </mbean>
      
       <tx-connection-factory>
       <jndi-name>FirebirdDS</jndi-name>
       <xa-transaction/>
       <track-connection-by-tx/>
       <rar-name>jaybird-2.0.1.rar</rar-name>
       <connection-definition>javax.sql.DataSource</connection-definition>
       <config-property name="Database" type="java.lang.String">localhost/3050:/vc/db/firebird/titan.fdb</config-property>
       <user-name>jboss</user-name>
       <password>XXX</password>
       <min-pool-size>0</min-pool-size>
       <metadata>
       <type-mapping>Firebird</type-mapping>
       </metadata>
       </tx-connection-factory>
      
      </connection-factories>
      



        • 1. Re: Retry: JBoss AS/Firebird: Hibernate Dialect must be expl
          weston.price

          Something must be going around today...

          This is not a JCA problem.

          Reason: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set for database: F
          


          Basically Hibernate (the underlying Entity persistence manager) is telling you that you need to specify the Hibernate dialect in your persistence.xml file.


          • 2. Re: Retry: JBoss AS/Firebird: Hibernate Dialect must be expl
            knaveofhearts

            With all due respect:
            (1) these were exactly the kinds of questions that were considered JCA problems when this forum was created--I know that, because I posted here on a couple occasions at that time and obtained helpful answers;
            (2) a search of the forums for this Firebird database connection problems shows that they *only* appear in this forum;
            (3) it is in the nature of this kind of question that where the solution lies is not obvious--JCA is certainly involved here; and
            (4) I still have no idea how to fix the problem, nor where to go for an answer.

            I followed all the instructions about how to set this up both in Burke's book and on the Firebird website. Why is Hibernate intruding here at all since the JCA connection being made is to Firebird via the two XML files? How does one specify the Hibernate dialect in a persistence.xml file, or find out how to do so? Thank you.

            • 3. Re: Retry: JBoss AS/Firebird: Hibernate Dialect must be expl
              weston.price

               

              <?xml version="1.0" encoding="UTF-8"?>
              <persistence>
               <persistence-unit name="titan">
               <jta-data-source>java:/FirebirdDS</jta-data-source>
               <properties>
               <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
               <property name="hibernate.dialect" value="org.hibernate.dialect.FirebirdDialect"/>
               </properties>
               </persistence-unit>
              </persistence>
              


              The reason Hibernate is 'intruding' is the your Persistence Provider, *Hibernate*, is telling you that he cannot automatically obtain type mappings and metadata for your platform of choice: *Firebird*.

              Also, I believe the mechanism for the Firebird JDBC configuration has changed recently, but I have to confirm this.




              • 4. Re: Retry: JBoss AS/Firebird: Hibernate Dialect must be expl
                knaveofhearts

                Thank you for your reply. That seems to have fixed the problem. If you do learn something about a change to the Firebird configuration (due to the anticipated FB 2.0 release possibly?), perhaps you could post it to this forum.

                K/H

                • 5. Re: Retry: JBoss AS/Firebird: Hibernate Dialect must be expl
                  weston.price

                  I will be looking at is as an update for the JCA handling of the Firebird driver. Any updates will be posted to the Wiki along with documentation changes. I just have to find the time to check it all in :-)