Hibernate version:
3.0.5
Mapping documents:
<hibernate-mapping>
<class name="pilates.Cliente" table="cliente">
<id name="idCliente" type="integer">
<generator class="native"/>
</id>
<property name="apellido" type="string"/>
<property name="cedula" type="string"/>
<property name="direccion" type="string"/>
<property name="edad" type="string"/>
<property name="estadoCivil" type="string"/>
<property name="huella" type="string"/>
<property name="mail" type="string"/>
<property name="nombre" type="string"/>
<property name="sexo" type="string"/>
<property name="telefono" type="string"/>
<property name="celular" type="string"/>
<property name="observaciones" type="string"/>
<property name="activo" type="string"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Session session = Hibernate.currentSession(); // Transaction tx =
//session.beginTransaction();
// session.saveOrUpdate(u);
Query q = session
.createQuery("FROM Cliente WHERE nombre like :nombre AND apellido like :apellido AND cedula like :cedula and activo = :activo");
q.setString("activo", "T");
if (c.getNombre() != null)
q.setString("nombre", "%" + c.getNombre() + "%");
else
q.setString("nombre", "%");
if (c.getApellido() != null)
q.setString("apellido", "%" + c.getApellido() + "%");
else
q.setString("apellido", "%");
if (c.getCedula() != null)
q.setString("cedula", "%" + c.getCedula() + "%");
else
q.setString("cedula", "%"); // tx.commit();
exists = q.list();
Hibernate.closeSession();
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL, version: 4.1.14-nt
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hello everyone:
My problem is the following:
I'm developing a app for a Gym (Clients control, Accounting staff, etc...). I decided to use hibernate integrated with a SWT application.
I always ran the test using only 1 machine, but today testing the app with 2 computer I realized that some changes made with one client to the database are not read by the other client.
I set the caches to false so hibernate has to go the the db for a query.
But the result is the un-expected.
I hope someone can help me.
Regards
Thanks
Pablo
|