Avec Hibernate 3.0, le code suivant :
Code:
Session session = sessionFactory.openSession();
tx = session.beginTransaction();
Dog dog = new Dog("Zeus");
session.save(dog);
session.evict(dog);
dog.setName("Apollo");
tx.commit();
Génère une AssertionFailure :
Code:
15:33:21,519 ERROR AssertionFailure:22 - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: possible nonthreadsafe access to session
...
Même le code peut paraître êtrange, Est-ce normal ?