-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: What happens when Remote DB gets reset?
PostPosted: Tue Aug 27, 2013 4:22 pm 
Newbie

Joined: Tue Aug 27, 2013 4:08 pm
Posts: 2
Greetings!
I have a functional web application using hibernate and running on JBOSS. Hibernate is pointing to a remote database.
Everything seems to work great until the remote DB is deleted and rebuilt. Once that happens we start getting hibernate errors until we reboot JBOSS, then everything works as expected.

Here is the generated error message:
Code:
--------------------------------------------------------------------------------------------------------------------------------------------------------
11:31:50,323 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8282-7) An I/O error occured while sending to the backend.
11:31:50,339 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8282-8) An I/O error occured while sending to the backend.
11:31:50,323 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8282-6) An I/O error occured while sending to the backend.
11:31:50,323 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8282-9) An I/O error occured while sending to the backend.
11:31:50,854 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http--0.0.0.0-8282-7) ERROR: column assignedta0_.actionrequested does not exist
  Position: 43
-----------------------------------------------------------------------------------------------------------------------------------------------------


Wondering what could be causing this problem and if there is a way around so we don't need to reboot the server every time.

The persistence file looks like this:

Code:
<persistence 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"
        version="2.0">
    <persistence-unit name="org.hibernate.events.jpa" transaction-type="RESOURCE_LOCAL">
   
        <class>mil.navy.spawar.service.db.object.AssignedTasks</class>
       <properties>
           <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>

           <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
           <property name="hibernate.connection.url" value="${jdbc.connection.url}"/>
           <property name="hibernate.connection.username" value="username"/>
           <property name="hibernate.connection.password" value="password"/>
           <property name="hibernate.connection.pool_size" value="5"/>

           <property name="hibernate.show_sql" value="false"/>
           <property name="hibernate.format_sql" value="true"/>

           <property name="hibernate.max_fetch_depth" value="5"/>

           <property name="hibernate.hbm2ddl.auto" value="update"/>
           
            <!-- Scan for annotated classes and Hibernate mapping XML files -->
          <property name="hibernate.archive.autodetection" value="class, hbm"/>
           
       </properties>
    </persistence-unit>
</persistence>


Top
 Profile  
 
 Post subject: Re: What happens when Remote DB gets reset?
PostPosted: Tue Aug 27, 2013 8:16 pm 
Newbie

Joined: Tue Aug 27, 2013 4:08 pm
Posts: 2
Turns out that one of the fields was not mapped correctly. When hibernate was started up, it created the field it thought was missing. When the DB was deleted and recreated, hibernate was not able to find that field anymore.

After mapping the field correctly, everything works as expected.

IE:

Code:
   @Column(name = "action_requested")
   private String actionRequested;


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.