Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7955065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:37:23+00:00 2026-06-04T03:37:23+00:00

<id name=idInstance type=java.lang.Integer> <column name=ID_INSTANCE /> <generator class=native /> </id> <property name=nom type=string> <column

  • 0

    <id name="idInstance" type="java.lang.Integer">
        <column name="ID_INSTANCE" />
        <generator class="native" />
    </id>


    <property name="nom" type="string">
        <column name="NOM" length="50" not-null="true" />
    </property>

            <property name="description" type="string">
        <column name="DESCRIPTION" length="300" not-null="true" />
    </property>

    <set name="statistiques" cascade="all" lazy="false">
        <key column="ID_INSTANCE"></key>
        <one-to-many class="Statistique" />
    </set>
        </class>

and the hbm file of class statistique is :

<class name="Statistique" table="STATISTIQUE">

    <id name="idStatistique" type="java.lang.Integer">
        <column name="ID_STATISTIQUE"/>
        <generator class="native" />
    </id>

    <property name="tempsReponse" type="java.lang.Double">
        <column name="TEMPS_REPONSE"/>
    </property>

    <property name="date" type="timestamp">
        <column name="DATE"/>
    </property>

</class>

If the statistiques list is empty, this seems to be working fine. It fails with a foreign key violation error :

Integrity constraint violation FKD18D3C4EDC6F4BFB table: STATISTIQUE in statement [delete from INSTANCE_Monitor where (ID_INSTANCE) IN (select ID_INSTANCE from HT_INSTANCE_Monitor)]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:37:25+00:00Added an answer on June 4, 2026 at 3:37 am

    You probably have a constraint in the database which demands for every row in statistique the existence of the row in instance_monitor. Before you can delete rows in instance_monitor, you have to delete the appertaining rows in statistique.

    The clause cascade="all" does not imply a cascade delete on database level. It just forces hibernate to generate explicit delete statements for the child table (statistique in your case). The problem is, the delete statements may arrive in an order which is not compatible with your database constraint. This also can happen due to hibernate’s re-ordering of database statements.

    What you can do: Either remove the database constraint (if possible) or

    1. Delete the rows from the statistique table, which belong to the instance_monitor “manually (“i. e. with separate delete statements)
    2. Call session.flush() (prevents against the statement re-ordering by hibernate)
    3. delete the instance_monitor
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

By default, grails seems to return <class name>:<id> for toString() of an Java domain
If I have a class Person which has two instance variables: name of type
I'm trying to get the instance name of my class. The way I do
Assuming I have a instance of class A (name it AI) that has an
I have the following model and instance: class Bashable(models.Model): name = models.CharField(max_length=100) >>> foo
In java can an instance variable and a method have the same name without
When I run grails install-dependency , I get this. java.lang.LinkageError: loader constraint violation: loader
I saw an example that try to explain inheritance in Java. The class Employee,
java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/web/tomcat/tc5/WebAppClassLoader) previously initiated loading for a different
I'm having NullPointerException trying to getCurrentSession() java.lang.NullPointerException servlets.ControlServlet.doPost(ControlServlet.java:46) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) I use Tomcat 5.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.