Hello all
My first Hibernate project and I'm having a very strange problem:
Calls to
Code:
Session.update(Object)
generates insert sql instead for update sql as i would expect. The same happens with calls to
Code:
Session.saveOrUpdate(Object)
, regradless of id value.
Pattern:
Each persistent entity in the model has a native generated long id field, with null value indicating a new object and calls to save(). The entities also have a version field.
The model is driven by a jmx
Code:
HibernateService
MBean running inside Jboss 3.2.2. I use Statless session beans to access data, no DAO as i find the Session object to be a sufficient DAO for the project.
The beans obtain a
Code:
SessionFactory
in their
Code:
setSessionContext()
methods, and create a new Session in each business method, for instance when calling update(). The session beans are operated by remote clients.
Before I post code&config&details , is there a simple explanation to my problem?
Help much appriciated!
Thanks
Trygve