-->
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.  [ 1 post ] 
Author Message
 Post subject: database not updated
PostPosted: Sat Jan 24, 2009 7:07 pm 
Newbie

Joined: Sat Jan 24, 2009 6:41 pm
Posts: 1
Hi,

I begin with hibernate and spring, I made a little web app with one bean, I insert a few entries automatically when my app start, I am able to get the entries from my database and to dipslay a list on a JSP but when I try to add entries through my JSP page, my database is not updated, but the entry appear on my list on my JSP page (with firefox only, not with the browser embedded with Eclipse). There is no exceptions or errors.

I think Hibernate use some cache but I don't know how to do to make hibernate commit the changes into the database. I use MySQL.

I use Hibernate with .hbm.xml mappings and JBoss 5.

My persistence.xml :

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_1_0.xsd" version="1.0">

    <persistence-unit name="MyMovies">

        <!-- A datasource managed by the Java EE runtime environment -->
        <jta-data-source>java:/MyMoviesDS</jta-data-source>

        <properties>
            <property name="hibernate.archive.autodetection" value="class, hbm"/>

            <!-- SQL stdout logging -->
            <property name="hibernate.show_sql" value="true"/>
            <property name="hibernate.format_sql" value="true"/>
            <property name="use_sql_comments" value="true"/>
           

         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
         <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
         <property name="hibernate.connection.url" value="jdbc:mysql://localhost/MyMovies"/>
         <property name="hibernate.connection.username" value="root"/>
         <property name="hibernate.connection.password" value=""/>

            <!-- On deployment of this persistence unit, drop and then re-create all tables -->
            <property name="hibernate.hbm2ddl.auto" value="create"/>

        </properties>
    </persistence-unit>

</persistence>


any ides ?


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

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.