Hi everybody,
yesterday we encountered a strange (and a bit worrying) behaiour on our web application, using Hibernate 3.6.7.Final and PostgreSQL 9.0.7.
We installed in production environment this new many-to-one mapping relation on the Java class "OperazioneDiCarico.java", here follows a part of Hibernate mapping:
Code:
<class name="it.loginet.petrol.domain.carico.OperazioneDiCarico">
<id name="id" access="field">
<generator class="assigned"/>
</id>
........
<many-to-one name="inizioCarico" class="it.loginet.petrol.domain.carico.RichiestaAutorizzazioneCarico" access="field" cascade="save-update" unique="true"/>
........
which relates to a new Java class mapped in this way, RichiestaAutorizzazioneCarico.java, mapping follows:
Code:
<class name="it.loginet.petrol.domain.carico.RichiestaAutorizzazioneCarico" table="iniziocarico">
<id name="id" access="field">
<generator class="native" />
</id>
<property name="codiceCorsia" access="field" />
<property name="mezzoBadgeCode" access="field" />
<set name="autorizzazioneAlCaricoBraccio" lazy="false" cascade="all"
access="field">
<key column="richiestaAutorizzazioneCarico" not-null="true" />
<one-to-many
class="it.loginet.petrol.domain.carico.AutorizzazioneAlCaricoBraccio" />
</set>
<set name="autorizzazioneAlCaricoAdditivatore" lazy="false"
cascade="all" access="field">
<key column="richiestaAutorizzazioneCarico" not-null="true" />
<one-to-many
class="it.loginet.petrol.domain.carico.AutorizzazioneAlCaricoAdditivatore" />
</set>
</class>
<class name="it.loginet.petrol.domain.carico.AutorizzazioneAlCaricoBraccio" table="iniziocaricoperbraccio">
<id name="id" access="field">
<generator class="native" />
</id>
<property name="numeroBraccio" access="field" />
<property name="braccioFunzionante" access="field" />
<property name="totaleNonAzzerabile" access="field" />
<property name="totaleNonAzzerabile15" access="field" />
</class>
<class
name="it.loginet.petrol.domain.carico.AutorizzazioneAlCaricoAdditivatore" table="iniziocaricoperadditivatore">
<id name="id" access="field">
<generator class="native" />
</id>
<property name="numeroBraccio" access="field" />
<property name="codiceAdditivatore" access="field" />
<property name="additivatoreFunzionante" access="field" />
<property name="totaleNonAzzerabile" access="field" />
</class>
The first day of production everything goes fine, the update statement on class OperazioneDiCarico.java and the insert statement for class RichiestaAutorizzazioneCarico (with the 2 other classes in cascade) worked perfectly, the persistence on database was ok.
Unfortunately the second day something went wrong, we can't really understand what.
Simply, the persistence of the class with many-to-one relation RichiestaAutorizzazioneCarico stopped working, no more inserts were done on the DB and we can't find the reason.
No exception was logged from our application, in the next days we will monitor Hibernate logging to see if something appears while the application should create and execute the inserts statements on DB.
Have you encountered something similar with your applications? We made other similar mappings in our applications and they continues to work fine without problems.
If I found notable data on the Hibernate log4j while monitoring the application, I'll append here as soon as possible. If I missed something important, just tell me and I'll update the post
Thanks for your help in advance.
Leonardo