Announcement Announcement Module
Collapse
No announcement yet.
Problem with Struts + Spring + Hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Struts + Spring + Hibernate

    Hi,

    I have a (strange) problem using Hibernate together with Spring / Struts on a Tomcat Server. When I deploy my Project (using Eclipse WTP), I get the following error in the console:
    Code:
    14.06.2007 14:19:13 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
    SCHWERWIEGEND: could not get database metadata
    com.ibm.db2.jcc.c.SQLException: DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: SEQNAME
    .....
    .....
    14.06.2007 14:19:13 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
    SCHWERWIEGEND: could not complete schema update
    com.ibm.db2.jcc.c.SQLException: DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: SEQNAME
    But after this the deployment continues and I can access the tables with hibernate. I don't know why this appears, does anybody has an idea?
    To access hibernate I'm using the org.springframework.orm.hibernate3.LocalSessionFac toryBean-Class. For the datasource I'm using the com.mchange.v2.c3p0.ComboPooledDataSource-Class.
    And my database is a DB2-Database

    Thanks in advance

  • #2
    It is a WARNING not an error. You are using the schemaUpdate tool from hibernate it informs you that something couldn't be done (something with a sequence?). But it isn't stopping your application.

    Comment


    • #3
      Hi mdeinum,
      you're right, the application doesn't stop but I wonder because the message is marked as GRAVE, not just as warning. And it takes pretty long to deploy because hibernate is trying to do sth. that does'nt work and it takes a pretty long time (about 70!! seconds). Everytime I want to test something I have to wait because of this warning...
      Does anybody know if its possible to switch this behaviour of (whatever hibernate does there)...?

      Thanks

      Comment


      • #4
        It isn't because of the warning that it takes so long, but it is because of the schemaUpdate that it takes so long. Just disable it (your schema wont' be automatically updated anymore!) and startup times should become faster.

        Comment


        • #5
          Hi mdeinum,

          I already set the schemaUpdate-Flag to false:

          Code:
          <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
          	<property name="schemaUpdate" value="false" />
          	<property name="dataSource" ref="dataSource" />
          	<property name="mappingResources">
              		<list>
              			<value>Mandant.hbm.xml</value>
              			<value>Filiale.hbm.xml</value>
              		</list>
           	</property>
           	<property name="hibernateProperties">
           		<props>
           			<prop key="hibernate.hbm2ddl.auto">update</prop>
          	   	<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
          		<prop key="hibernate.show_sql">true</prop>
          		   	<prop key="hibernate.c3p0.timeout">20000</prop>	
          		   	<prop key="hibernate.format_sql">true</prop>
          		</props>
          	 </property>
          </bean>
          But theres no affect, it still takes so long...

          Comment


          • #6
            I think you need to remove the property.
            Code:
            <prop key="hibernate.hbm2ddl.auto">update</prop>
            Last edited by karldmoore; Aug 30th, 2007, 06:24 AM.

            Comment


            • #7
              Thanks a lot, now it works fine...

              Comment


              • #8
                Great! I've just noticed a post on the Hibernate forum that looks like that same thing. Was that you as well? Might be an idea to post the solution there as well.
                Last edited by karldmoore; Aug 30th, 2007, 06:24 AM.

                Comment


                • #9
                  Hi karldmoore,

                  you're right, that was also me. I'll post the solution there... Thanks again...

                  Comment


                  • #10
                    Originally posted by orribl View Post
                    Hi karldmoore, you're right, that was also me. I'll post the solution there... Thanks again...
                    Not a problem! I thought it looked familiar .
                    Last edited by karldmoore; Aug 30th, 2007, 06:23 AM.

                    Comment

                    Working...
                    X