Hibernate version: 3.1
Name and version of the database you are using: MySQL 5.0
hibernate.properties
...
hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider
hibernate.cache.use_query_cache=false
hibernate.cache.use_second_level_cache=false
Settings.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.dareit.warranty.mapping">
<class
name="Settings"
table="settings"
dynamic-insert="false"
dynamic-update="false">
<!--cache usage="read-write" /-->
<id
name="Id"
type="integer"
column="id"
>
<generator class="increment"/>
</id>
<property
name="SetKey"
column="set_key"
type="string"
not-null="false"
length="50"
/>
<property
name="SetValue"
column="set_value"
type="string"
not-null="false"
length="255"
/>
<property
name="Visible"
column="visible"
type="java.lang.Short"
not-null="false"
length="6"
/>
</class>
</hibernate-mapping>
I create a Session like this:
Code:
sf = c.buildSessionFactory();
session = sf.openSession();
The problem is following:
1. I use application x with Hibernate to receive records from the table (in a transaction).
2. I modify a record with an external query (MySQL Command Line)
3. From the application x I make a new criteria list to get the newest records but I receive the old records (without last updates).
More details:
I use the same session for first and second criteria list.
The problem disapear if I made a session.clean() between first and second list, but I may not use clean because I loss some other important things from session (the application is more complex).
To make the problem simplier: I have to instances of application x in separate JVM that use the same MySQL server and have to take care about each modifications from the another application. I don't want to use at all cache systems.
What can be the easiest solution for this problem?
Sorry if the problem was described somewhere in the forum, I searched for a solution but I didn't find a good solution for this case.