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 6239457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:23:40+00:00 2026-05-24T11:23:40+00:00

I have a legacy web app that I am maintaining. It started out as

  • 0

I have a legacy web app that I am maintaining. It started out as Java 1.4, but I’ve compiled it to Java5. We’re using Spring+Hibernate. I’m not using annotations yet. I’m sticking with XDoclet for now. In it, I have an object graph that looks like this:

Job 1:m Operations 1:m Activities 1:m Transactions

Those Transactions are NOT J2EE transactions. We’re just documenting the workflow from one Activity to another.

In HttpRequest#1, I update a couple of Activities and create a new Transaction. Then in HttpRequest#2, I redisplay the entire Job. What I am seeing at this point is the usual SELECT statements for the Job, Operations and Activities, but then I’m seeing some UPDATE statements for the Transactions. It turns out those updates are reverting the Transactions back to their previous states, discarding the latest updates.

Why in the world is Hibernate doing this?

As requested, here’s the .hbm.xml file:

<hibernate-mapping>
  <class name="ActivityTransaction" table="imed_if_move_transactions"
    lazy="false" mutable="true">
    <cache usage="nonstrict-read-write" />
    <id name="id" column="IF_MOVE_TRANSACTION_ID" type="java.lang.Long">
      <generator class="sequence">
        <param name="sequence">IMED_IF_MOVE_TRANSACTIONS_S</param>
      </generator>
    </id>
    <property name="activityActionKey" type="java.lang.String"
      update="true" insert="true" column="ACTIVITY_ACTION_KEY" />
    <property name="approvalStatus" type="int" update="true"
      insert="true" column="APPROVAL_STATUS" />
    <property name="authorizedBy" type="java.lang.Long" update="true"
      insert="true" column="AUTHORIZATION_ID" />
    <many-to-one name="authorizedByUser"
      class="UserModel" cascade="none"
      outer-join="false" update="false" insert="false" not-found="ignore"
      fetch="select" column="AUTHORIZATION_ID" />
    <property name="date" type="java.util.Date" update="true"
      insert="true" column="JOA_TRANSACTION_DATE" />
    <many-to-one name="from"
      class="JobOpActivity" cascade="none"
      outer-join="false" update="true" insert="true" fetch="select"
      column="FM_JOB_OP_ACTIVITY_ID" />
    <property name="fromIntraActivityStepType" type="java.lang.Integer"
      update="true" insert="true" column="FM_INTRAACTIVITY_STEP_TYPE" />
    <property name="fromIntraOperationStepType" type="java.lang.Integer"
      update="true" insert="true" column="FM_INTRAOPERATION_STEP_TYPE" />
    <property name="fromOperationSeqNum" type="java.lang.Integer"
      update="true" insert="true" column="FM_OPERATION_SEQ_NUM" />
    <many-to-one name="job" class="Job"
      cascade="none" outer-join="false" update="true" insert="true" fetch="select"
      column="WIP_ENTITY_ID" />
    <property name="operationEndDate" type="java.util.Date"
      update="true" insert="true" column="OP_END_DATE" />
    <property name="operationStartDate" type="java.util.Date"
      update="true" insert="true" column="OP_START_DATE" />
    <many-to-one name="organization" class="Organization"
      cascade="none" outer-join="false" update="true" insert="true" fetch="select"
      column="ORGANIZATION_ID" />
    <property name="processingStatus" type="java.lang.String"
      update="true" insert="true" column="PROCESS_FLAG" />
    <property name="quantity" type="int" update="true" insert="true"
      column="TRANSACTION_QUANTITY" />
    <property name="reasonId" type="java.lang.Long" update="true"
      insert="true" column="REASON_ID" />
    <property name="reference" type="java.lang.String" update="true"
      insert="true" column="REFERENCE" />
    <property name="scrapAccountId" type="java.lang.Long" update="true"
      insert="true" column="SCRAP_ACCOUNT_ID" />
    <property name="spsaId" type="java.lang.Long" update="true"
      insert="true" column="SPSA_ID" />
    <many-to-one name="to"
      class="JobOpActivity" cascade="none"
      outer-join="false" update="true" insert="true" fetch="select"
      column="TO_JOB_OP_ACTIVITY_ID" />
    <property name="toIntraActivityStepType" type="java.lang.Integer"
      update="true" insert="true" column="TO_INTRAACTIVITY_STEP_TYPE" />
    <property name="toIntraOperationStepType" type="java.lang.Integer"
      update="true" insert="true" column="TO_INTRAOPERATION_STEP_TYPE" />
    <property name="toOperationSeqNum" type="java.lang.Integer"
      update="true" insert="true" column="TO_OPERATION_SEQ_NUM" />
    <property name="typeId" type="java.lang.Long" update="true"
      insert="true" column="TRANSACTION_TYPE_ID" />
    <property name="webKeyEntryId" type="java.lang.String"
      update="true" insert="true" column="WEB_KEY_ENTRY_ID" />
    <property name="issueMaterial" type="true_false" update="true"
      insert="true" column="MATERIAL_ISSUE" />
    <property name="createDate" type="java.util.Date" update="true"
      insert="true" column="CREATION_DATE" />
    <property name="createdBy" type="java.lang.Integer" update="true"
      insert="true" column="CREATED_BY" />
    <property name="lastUpdateDate" type="java.util.Date" update="true"
      insert="true" column="LAST_UPDATE_DATE" />
    <property name="lastUpdatedBy" type="java.lang.Integer"
      update="true" insert="true" column="LAST_UPDATED_BY" />
  </class>
</hibernate-mapping>

And here’s an example transaction setup:

<bean id="moldingActivitiesService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager" ref="etrack2ProviderTransactionManager"/>
  <property name="target" ref="moldingActivitiesServiceTarget"/>
  <property name="transactionAttributes">
    <props>
      <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
  </property>
</bean>
  • 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-05-24T11:23:40+00:00Added an answer on May 24, 2026 at 11:23 am

    Ok, finally found the problem. Here’s a more complete flow:

    I have Controller C1, Manager M1, Manager M2 and Persister P1. M1 and M2 have managed transactions as I stated above, using TransactionProxyFactoryBean.

    • C1.methodA() calls M1.methodB() which calls P1.methodC()
    • C1.methodA() then calls M2.methodD(), which then calls M1.methodE() which calls P1.methodF().

    See the problem yet?

    It happens when M1.methodD calls M1.methodE(). What I think happens is that since both M1 and M2 are transaction managed, two transactions are created, one for each call. Those two transactions battle it out for which one has the true state of the system, with neither one truly winning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I have an unconventional legacy asp.net 1.1 web app that uses the src attribute
I have a legacy C++ module that offers encryption/decryption using the openssl library (DES
I have a legacy VB6 application that was built using MSDE. As many client's
I have a legacy web app running in Tomcat 5.0. This web app has
I have a legacy app that seems to be exporting/saving files with CArchive (legacy
I have a legacy Rails project (2.4) that used to work in Netbeans. But
I have a new web app that is packaged as a WAR as part
The legacy web app I have inherited, which was custom-written for Oxfam New Zealand

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.