-->
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.  [ 3 posts ] 
Author Message
 Post subject: optimum configuration for mysql (hibernate.cfg.xml)
PostPosted: Thu Apr 10, 2008 11:31 am 
Beginner
Beginner

Joined: Wed Oct 03, 2007 9:46 pm
Posts: 37
my configuration look like below, but when i monually go to mysql front and modify a record inside a table and follow by use hibernate to retrive the record, i still get old "record" . the record from hibernate query seem to be inconsistent . can someone post an optimum configuration for mysql?


I already use the property <property name="connection.isolation">2</property>

but still, i get old record . is it because of "caching" ?


Code:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
   <session-factory>
      <!-- properties -->
               

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


<property name="c3p0.min_size">10</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.timeout">10</property>
<property name="c3p0.acquireRetryAttempts">30</property>

<property name="c3p0.acquireIncrement">5</property>

<property name="c3p0.idleConnectionTestPeriod">300</property>

<property name="c3p0.initialPoolSize">20</property>
<property name="c3p0.maxPoolSize">100</property>
<property name="c3p0.maxIdleTime">300</property>
<property name="c3p0.maxStatements">50</property>
<property name="c3p0.minPoolSize">10</property>
 

<!-- Transaction isolation 2 = READ_COMMITTED -->
<property name="connection.isolation">2</property>       
     
               
      <property name="show_sql">false</property>
      <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
               

               
                <!--
                <property name="hibernate.hbm2ddl.auto">create</property>
      <property name="hibernate.hbm2ddl.auto">update</property>
                -->
               
                <!-- mapping files -->
      <mapping resource="com/program/entity/tableobject.xml" />
      </session-factory>
</hibernate-configuration>



Top
 Profile  
 
 Post subject: Re: optimum configuration for mysql (hibernate.cfg.xml)
PostPosted: Fri Apr 11, 2008 10:09 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
how does the code that fetches the data look like? and what's the sequence?


Farzad-


Top
 Profile  
 
 Post subject: =)
PostPosted: Fri Apr 11, 2008 9:22 pm 
Beginner
Beginner

Joined: Wed Oct 03, 2007 9:46 pm
Posts: 37
i found out a way to make hibernate always read from db. i do a clear before i retrieve data.

Session sess = HibernateSessionFactory.currentSession();

sess.clear();


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.