-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Hibernate getHibernateTemplate().get generating update calls
PostPosted: Tue Jan 09, 2007 11:25 am 
Newbie

Joined: Tue Jan 09, 2007 10:52 am
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

I am not sure if there is an issue with my mappings or if this is normal behavior but I suspect the behavior is abnormal. There are unwanted updates occurring when I do a simple get on an account. The account has one to many relationships with the preferences, banking infos, payment opt revocations and monthly payments. In the case of monthly payments I have an xref table to work with, however in the other cases I have a foreign key of billing_account within the child tables. Any help would be appreciated. I have been over and over the documentation and I have scoured the internet for similar problems but I have come up empty handed. Thanks in advance.

Hibernate version: 3.1.3

Mapping documents:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="ca.medavie.pb.billing.bill.bo.BillingAccount"
table="BILLING_ACCOUNT" abstract="true" discriminator-value="0" lazy="false">

<id name="id" type="string">
<generator class="assigned"/>
</id>

<discriminator column="ACCOUNT_TYPE" type="integer"/>

<property name="billedUpToDate" type="timestamp" column="BILLED_UP_TO_DATE"/>
<property name="terminationDate" type="timestamp" column="TERMINATION_DATE"/>
<property name="effectiveDate" type="timestamp" column="EFFECTIVE_DATE"/>
<property name="active" type="ca.medavie.pb.common.hibernate.usertypes.YNToBooleanUserType" column="ACTIVE"/>
<property name="overdueDate" type="date" column="OVERDUE_DATE"/>
<property name="createdBy" type="string" column="CREATED_BY"/>
<property name="modifiedBy" type="string" column="MODIFIED_BY"/>
<property name="createdDate" type="date" column="CREATED_DATE"/>
<property name="modifiedDate" type="date" column="MODIFIED_DATE"/>
<property name="accountType" type="integer" column="ACCOUNT_TYPE" insert="false" update="false"/>

<!-- One BillingAccount For Many Monthly Payments Using Xref Table -->
<bag name="monthlyPayments" table="BILL_ACC_MONTHLY_PAY_XREF"
cascade="all" lazy="false" inverse="true">
<key column="BILLING_ACCOUNT_ID" not-null="true"/>
<many-to-many column="MONTHLY_PAYMENT_ID"
class="ca.medavie.pb.billing.assessment.bo.MonthlyPayment"/>
</bag>

<bag name="paymentOptionRevocations" table="PAYMENT_OPT_REVOCATION"
cascade="all" lazy="false">
<key column="BILLING_ACCOUNT_ID" not-null="true"/>
<one-to-many class="ca.medavie.pb.billing.bill.bo.PaymentOptionRevocation"/>
</bag>

<bag name="billingPreferencesRecs" table="BILLING_PREFERENCES"
lazy="false" order-by="EFFECTIVE_DATE desc">
<key column="BILLING_ACCOUNT_ID" not-null="true"/>
<one-to-many class="ca.medavie.pb.billing.bill.bo.BillingPreferences"/>
</bag>

<bag name="bankingInfoRecs" table="BANKING_INFO"
lazy="false" order-by="EFFECTIVE_DATE desc">
<key column="BILLING_ACCOUNT_ID" not-null="true"/>
<one-to-many class="ca.medavie.pb.billing.bill.bo.BankingInfo"/>
</bag>

<subclass name="ca.medavie.pb.billing.bill.bo.ExternalPayorBillingAccount" discriminator-value="1">

<bag name="billingAccountPayors" table="BILLING_ACCOUNT_PAYOR"
lazy="false">
<key column="billing_account_id"/>
<one-to-many class="ca.medavie.pb.billing.bill.bo.BillingAccountPayor"/>
</bag>

</subclass>

<subclass name="ca.medavie.pb.billing.bill.bo.InsuredBillingAccount" discriminator-value="2">

<bag name="billableInsureds" table="SENIOR"
lazy="false">
<key column="health_card_number"/>
<one-to-many class="ca.medavie.pb.insured.bo.Insured"/>
</bag>

</subclass>

</class>
</hibernate-mapping>

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="ca.medavie.pb.billing.bill.bo.BillingPreferences"
table="BILLING_PREFERENCES" lazy="false">
<id name="id" type="long">
<generator class="sequence">
<param name="sequence">billing_preferences_id_seq</param>
</generator>
</id>
<property name="billingMethodType" type="ca.medavie.pb.billing.dao.hibernate.BillingMethodUserType" column="BILLING_METHOD_TYPE"/>
<property name="effectiveDate" type="timestamp" column="EFFECTIVE_DATE"/>
<property name="terminationDate" type="timestamp" column="TERMINATION_DATE"/>
<property name="correspondenceType" type="long" column="CORRESPONDENCE_TYPE"/>
<property name="mailInvoiceIndicator" type="ca.medavie.pb.common.hibernate.usertypes.YNToBooleanUserType" column="MAIL_INVOICE_IND"/>
<property name="createdBy" type="string" column="CREATED_BY"/>
<property name="modifiedBy" type="string" column="MODIFIED_BY"/>
<property name="createdDate" type="date" column="CREATED_DATE"/>
<property name="modifiedDate" type="date" column="MODIFIED_DATE"/>
<property name="billingAccountId" type="string" column="BILLING_ACCOUNT_ID" insert="false" update="false"/>

<many-to-one
name="billingFrequency"
class="ca.medavie.pb.billing.bill.bo.BillingFrequency"
column="BILL_FREQUENCY_ID"
unique="true"
not-null="true"/>

<many-to-one
name="billingCycle"
class="ca.medavie.pb.billing.bill.bo.BillingCycle"
column="BILLING_CYCLE_ID"
unique="true"
not-null="true"/>

</class>
</hibernate-mapping>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="ca.medavie.pb.billing.bill.bo.PaymentOptionRevocation"
table="PAYMENT_OPT_REVOCATION" lazy="false">
<id name="id" type="long">
<generator class="sequence">
<param name="sequence">payment_opt_revocation_id_seq</param>
</generator>
</id>

<property name="reinstated" type="ca.medavie.pb.common.hibernate.usertypes.YNToBooleanUserType" column="REINSTATED"/>
<property name="type" type="ca.medavie.pb.billing.dao.hibernate.PaymentOptionUserType" column="PAYMENT_OPTION_ID"/>
<property name="createdBy" type="string" column="CREATED_BY"/>
<property name="modifiedBy" type="string" column="MODIFIED_BY"/>
<property name="createdDate" type="date" column="CREATED_DATE"/>
<property name="modifiedDate" type="date" column="MODIFIED_DATE"/>

<component name="revocationPeriod" class="ca.medavie.pb.common.Period">
<property name="startDate" column="REVOCATION_START_DATE"/>
<property name="endDate" column="REVOCATION_END_DATE"/>
</component>

</class>
</hibernate-mapping>

<hibernate-mapping>
<class name="ca.medavie.pb.billing.bill.bo.BankingInfo"
table="BANKING_INFO" lazy="false">
<id name="id" type="long">
<generator class="sequence">
<param name="sequence">banking_info_id_seq</param>
</generator>
</id>

<property name="bankNumber" type="string" column="BANK_NUMBER"/>
<property name="branchNumber" type="string" column="BRANCH_NUMBER"/>
<property name="accountNumber" type="string" column="ACCOUNT_NUMBER"/>
<property name="originatorNumber" type="string" column="ORIGINATOR_NUMBER"/>
<property name="withdrawalDay" type="integer" column="WITHDRAWAL_DAY"/>
<property name="createdBy" type="string" column="CREATED_BY"/>
<property name="modifiedBy" type="string" column="MODIFIED_BY"/>
<property name="createdDate" type="date" column="CREATED_DATE"/>
<property name="modifiedDate" type="date" column="MODIFIED_DATE"/>
<property name="billingAccountId" type="string" column="BILLING_ACCOUNT_ID" insert="false" update="false"/>

<component name="effectivePeriod" class="ca.medavie.pb.common.Period">
<property name="startDate" column="EFFECTIVE_DATE"/>
<property name="endDate" column="TERMINATION_DATE"/>
</component>

</class>
</hibernate-mapping>

<class name="ca.medavie.pb.billing.assessment.bo.MonthlyPayment"
table="MONTHLY_PAYMENT">
<id name="id" type="long">
<generator class="sequence">
<param name="sequence">monthly_payment_id_seq</param>
</generator>
</id>
<property name="year" type="integer" column="YEAR"/>
<property name="month" type="integer" column="MONTH"/>
<property name="paymentAmount" type="ca.medavie.pb.common.hibernate.usertypes.BigDecimalToNumberUserType" column="PAYMENT_AMOUNT"/>
</class>

Code between sessionFactory.openSession() and session.close():

Object o = getHibernateTemplate().get( BillingAccount.class, accountId );

Full stack trace of any exception that occurs:

Name and version of the database you are using:

Oracle 10g

The generated SQL (show_sql=true):

Hibernate: select billingacc0_.id as id0_, billingacc0_.BILLED_UP_TO_DATE as BILLED3_21_0_, billingacc0_.TERMINATION_DATE as TERMINAT4_21_0_, billingacc0_.EFFECTIVE_DATE as EFFECTIVE5_21_0_, billingacc0_.ACTIVE as ACTIVE21_0_, billingacc0_.OVERDUE_DATE as OVERDUE7_21_0_, billingacc0_.CREATED_BY as CREATED8_21_0_, billingacc0_.MODIFIED_BY as MODIFIED9_21_0_, billingacc0_.CREATED_DATE as CREATED10_21_0_, billingacc0_.MODIFIED_DATE as MODIFIED11_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_0_ from BILLING_ACCOUNT billingacc0_ where billingacc0_.id=?

Hibernate: select billablein0_.health_card_number as health1___, billablein0_.health_card_number as health1_0_, billablein0_.INCOME as INCOME35_0_, billablein0_.INCOME_TYPE as INCOME3_35_0_, billablein0_.INCOME_YEAR as INCOME4_35_0_, billablein0_1_.COMMON_FIRSTNAME as COMMON2_36_0_, billablein0_1_.COMMON_SURNAME as COMMON3_36_0_, billablein0_1_.BIRTH_DATE as BIRTH4_36_0_, billablein0_1_.GENDER as GENDER36_0_, billablein0_1_.SOCIAL_INSURANCE_NUMBER as SOCIAL6_36_0_, billablein0_1_.WORK_PHONE_NUMBER as WORK7_36_0_, billablein0_1_.HOME_PHONE_NUMBER as HOME8_36_0_, billablein0_1_.ARRIVAL_DATE as ARRIVAL9_36_0_, billablein0_1_.MOVED_FROM_INDICATOR as MOVED10_36_0_, billablein0_1_.MOVED_FROM_PROVINCE as MOVED11_36_0_, billablein0_1_.MOVED_TO_PROVINCE as MOVED12_36_0_, billablein0_1_.MOVED_FROM_CARD_NUMBER as MOVED13_36_0_, billablein0_1_.MOVED_TO_CARD_NUMBER as MOVED14_36_0_, billablein0_1_.DEPARTURE_DATE as DEPARTURE15_36_0_, billablein0_1_.INDIVIDUAL_NOTE as INDIVIDUAL16_36_0_, billablein0_1_.ALTERNATE_FIRSTNAME as ALTERNATE17_36_0_, billablein0_1_.ALTERNATE_SURNAME as ALTERNATE18_36_0_, billablein0_1_.CERTIFICATE_NUMBER as CERTIFI19_36_0_, billablein0_1_.APPLICATION_PRINT_DATE as APPLICA20_36_0_, billablein0_1_.APPLICATION_SENT_DATE as APPLICA21_36_0_, billablein0_1_.APPLICATION_PROCESSED_DATE as APPLICA22_36_0_, billablein0_1_.HEALTH_CARD_SEQ_NUMBER as HEALTH23_36_0_, billablein0_1_.RENEWAL_SENT_DATE as RENEWAL24_36_0_, billablein0_1_.RENEWAL_RECEIVED_DATE as RENEWAL25_36_0_, billablein0_1_.MODIFIED_BY as MODIFIED26_36_0_, billablein0_1_.LAST_MODIFIED as LAST27_36_0_, billablein0_1_.OLD_MSI_NUMBER as OLD28_36_0_, billablein0_1_.HEAD_OF_ADDRESS_LINK as HEAD29_36_0_ from senior billablein0_, individual billablein0_1_ where billablein0_.health_card_number=billablein0_1_.health_card_number and billablein0_.health_card_number=?
Hibernate: select bankinginf0_.BILLING_ACCOUNT_ID as BILLING11___, bankinginf0_.id as id__, bankinginf0_.id as id0_, bankinginf0_.BANK_NUMBER as BANK2_32_0_, bankinginf0_.BRANCH_NUMBER as BRANCH3_32_0_, bankinginf0_.ACCOUNT_NUMBER as ACCOUNT4_32_0_, bankinginf0_.ORIGINATOR_NUMBER as ORIGINATOR5_32_0_, bankinginf0_.WITHDRAWAL_DAY as WITHDRAWAL6_32_0_, bankinginf0_.CREATED_BY as CREATED7_32_0_, bankinginf0_.MODIFIED_BY as MODIFIED8_32_0_, bankinginf0_.CREATED_DATE as CREATED9_32_0_, bankinginf0_.MODIFIED_DATE as MODIFIED10_32_0_, bankinginf0_.BILLING_ACCOUNT_ID as BILLING11_32_0_, bankinginf0_.EFFECTIVE_DATE as EFFECTIVE12_32_0_, bankinginf0_.TERMINATION_DATE as TERMINA13_32_0_ from BANKING_INFO bankinginf0_ where bankinginf0_.BILLING_ACCOUNT_ID=? order by bankinginf0_.EFFECTIVE_DATE desc
Hibernate: select billingpre0_.BILLING_ACCOUNT_ID as BILLING11___, billingpre0_.id as id__, billingpre0_.id as id2_, billingpre0_.BILLING_METHOD_TYPE as BILLING2_23_2_, billingpre0_.EFFECTIVE_DATE as EFFECTIVE3_23_2_, billingpre0_.TERMINATION_DATE as TERMINAT4_23_2_, billingpre0_.CORRESPONDENCE_TYPE as CORRESPO5_23_2_, billingpre0_.MAIL_INVOICE_IND as MAIL6_23_2_, billingpre0_.CREATED_BY as CREATED7_23_2_, billingpre0_.MODIFIED_BY as MODIFIED8_23_2_, billingpre0_.CREATED_DATE as CREATED9_23_2_, billingpre0_.MODIFIED_DATE as MODIFIED10_23_2_, billingpre0_.BILLING_ACCOUNT_ID as BILLING11_23_2_, billingpre0_.BILL_FREQUENCY_ID as BILL12_23_2_, billingpre0_.BILLING_CYCLE_ID as BILLING13_23_2_, billingfre1_.type_code as type1_0_, billingcyc2_.id as id1_, billingcyc2_.MONTH_OFFSET as MONTH2_20_1_, billingcyc2_.DUE_DAY as DUE3_20_1_, billingcyc2_.CYCLE_NAME as CYCLE4_20_1_ from BILLING_PREFERENCES billingpre0_, BILL_FREQUENCY_TYPE billingfre1_, BILLING_CYCLE billingcyc2_ where billingpre0_.BILL_FREQUENCY_ID=billingfre1_.type_code and billingpre0_.BILLING_CYCLE_ID=billingcyc2_.id and billingpre0_.BILLING_ACCOUNT_ID=? order by billingpre0_.EFFECTIVE_DATE desc
Hibernate: select paymentopt0_.BILLING_ACCOUNT_ID as BILLING10___, paymentopt0_.id as id__, paymentopt0_.id as id0_, paymentopt0_.REINSTATED as REINSTATED34_0_, paymentopt0_.PAYMENT_OPTION_ID as PAYMENT3_34_0_, paymentopt0_.CREATED_BY as CREATED4_34_0_, paymentopt0_.MODIFIED_BY as MODIFIED5_34_0_, paymentopt0_.CREATED_DATE as CREATED6_34_0_, paymentopt0_.MODIFIED_DATE as MODIFIED7_34_0_, paymentopt0_.REVOCATION_START_DATE as REVOCATION8_34_0_, paymentopt0_.REVOCATION_END_DATE as REVOCATION9_34_0_ from PAYMENT_OPT_REVOCATION paymentopt0_ where paymentopt0_.BILLING_ACCOUNT_ID=?
Hibernate: select monthlypay0_.BILLING_ACCOUNT_ID as BILLING1___, monthlypay0_.MONTHLY_PAYMENT_ID as MONTHLY2___, monthlypay1_.id as id0_, monthlypay1_.YEAR as YEAR27_0_, monthlypay1_.MONTH as MONTH27_0_, monthlypay1_.PAYMENT_AMOUNT as PAYMENT4_27_0_ from BILL_ACC_MONTHLY_PAY_XREF monthlypay0_, MONTHLY_PAYMENT monthlypay1_ where monthlypay0_.MONTHLY_PAYMENT_ID=monthlypay1_.id and monthlypay0_.BILLING_ACCOUNT_ID=?
Hibernate: update BILLING_ACCOUNT set BILLED_UP_TO_DATE=?, TERMINATION_DATE=?, EFFECTIVE_DATE=?, ACTIVE=?, OVERDUE_DATE=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=? where id=?
Hibernate: update BANKING_INFO set BANK_NUMBER=?, BRANCH_NUMBER=?, ACCOUNT_NUMBER=?, ORIGINATOR_NUMBER=?, WITHDRAWAL_DAY=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, EFFECTIVE_DATE=?, TERMINATION_DATE=? where id=?
Hibernate: update BANKING_INFO set BANK_NUMBER=?, BRANCH_NUMBER=?, ACCOUNT_NUMBER=?, ORIGINATOR_NUMBER=?, WITHDRAWAL_DAY=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, EFFECTIVE_DATE=?, TERMINATION_DATE=? where id=?
Hibernate: update BILLING_PREFERENCES set BILLING_METHOD_TYPE=?, EFFECTIVE_DATE=?, TERMINATION_DATE=?, CORRESPONDENCE_TYPE=?, MAIL_INVOICE_IND=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, BILL_FREQUENCY_ID=?, BILLING_CYCLE_ID=? where id=?
2007-01-09 09:37:09,716;[DEBUG];ca.medavie.pb.billing.dao.hibernate.BillingMethodUserType;- nullSafeSet:binding '1' to parameter: 1
Hibernate: update BILLING_PREFERENCES set BILLING_METHOD_TYPE=?, EFFECTIVE_DATE=?, TERMINATION_DATE=?, CORRESPONDENCE_TYPE=?, MAIL_INVOICE_IND=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, BILL_FREQUENCY_ID=?, BILLING_CYCLE_ID=? where id=?
2007-01-09 09:37:09,716;[DEBUG];ca.medavie.pb.billing.dao.hibernate.BillingMethodUserType;- nullSafeSet:binding '1' to parameter: 1
Hibernate: update PAYMENT_OPT_REVOCATION set REINSTATED=?, PAYMENT_OPTION_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, REVOCATION_START_DATE=?, REVOCATION_END_DATE=? where id=?
2007-01-09 09:37:09,747;[DEBUG];ca.medavie.pb.billing.dao.hibernate.PaymentOptionUserType;- nullSafeSet:binding '2' to parameter: 2
Hibernate: update PAYMENT_OPT_REVOCATION set REINSTATED=?, PAYMENT_OPTION_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, REVOCATION_START_DATE=?, REVOCATION_END_DATE=? where id=?
2007-01-09 09:37:09,747;[DEBUG];ca.medavie.pb.billing.dao.hibernate.PaymentOptionUserType;- nullSafeSet:binding '2' to parameter: 2
Hibernate: update PAYMENT_OPT_REVOCATION set REINSTATED=?, PAYMENT_OPTION_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, REVOCATION_START_DATE=?, REVOCATION_END_DATE=? where id=?
2007-01-09 09:37:09,763;[DEBUG];ca.medavie.pb.billing.dao.hibernate.PaymentOptionUserType;- nullSafeSet:binding '2' to parameter: 2
Hibernate: select insuredadd0_.HEALTH_CARD_NUMBER as HEALTH1_0_, insuredadd0_.ADDRESS_TYPE as ADDRESS2_0_, insuredadd0_.ADDRESS_INDICATOR as ADDRESS3_0_, insuredadd0_.EFFECTIVE_DATE as EFFECTIVE4_37_0_, insuredadd0_.ADDRESS_LINE_1 as ADDRESS5_37_0_, insuredadd0_.ADDRESS_LINE_2 as ADDRESS6_37_0_, insuredadd0_.CITY as CITY37_0_, insuredadd0_.POSTAL_CODE as POSTAL8_37_0_, insuredadd0_.PROVINCE_CODE as PROVINCE9_37_0_, insuredadd0_.COUNTRY as COUNTRY37_0_ from individual_address insuredadd0_ where insuredadd0_.HEALTH_CARD_NUMBER=? and insuredadd0_.ADDRESS_TYPE=? and insuredadd0_.ADDRESS_INDICATOR=?
Hibernate: select billingacc0_.id as id0_, billingacc0_.BILLED_UP_TO_DATE as BILLED3_21_0_, billingacc0_.TERMINATION_DATE as TERMINAT4_21_0_, billingacc0_.EFFECTIVE_DATE as EFFECTIVE5_21_0_, billingacc0_.ACTIVE as ACTIVE21_0_, billingacc0_.OVERDUE_DATE as OVERDUE7_21_0_, billingacc0_.CREATED_BY as CREATED8_21_0_, billingacc0_.MODIFIED_BY as MODIFIED9_21_0_, billingacc0_.CREATED_DATE as CREATED10_21_0_, billingacc0_.MODIFIED_DATE as MODIFIED11_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_0_ from BILLING_ACCOUNT billingacc0_ where billingacc0_.id=?
Hibernate: select billingacc0_.billing_account_id as billing15___, billingacc0_.id as id__, billingacc0_.id as id0_, billingacc0_.NAME as NAME33_0_, billingacc0_.BILLING_ACCOUNT_ID as BILLING3_33_0_, billingacc0_.CREATED_BY as CREATED4_33_0_, billingacc0_.MODIFIED_BY as MODIFIED5_33_0_, billingacc0_.CREATED_DATE as CREATED6_33_0_, billingacc0_.MODIFIED_DATE as MODIFIED7_33_0_, billingacc0_.ADDRESS_LINE1 as ADDRESS8_33_0_, billingacc0_.ADDRESS_LINE2 as ADDRESS9_33_0_, billingacc0_.ADDRESS_LINE3 as ADDRESS10_33_0_, billingacc0_.CITY as CITY33_0_, billingacc0_.PROVINCE as PROVINCE33_0_, billingacc0_.POSTAL_CODE as POSTAL13_33_0_, billingacc0_.COUNTRY as COUNTRY33_0_ from BILLING_ACCOUNT_PAYOR billingacc0_ where billingacc0_.billing_account_id=?
Hibernate: select bankinginf0_.BILLING_ACCOUNT_ID as BILLING11___, bankinginf0_.id as id__, bankinginf0_.id as id0_, bankinginf0_.BANK_NUMBER as BANK2_32_0_, bankinginf0_.BRANCH_NUMBER as BRANCH3_32_0_, bankinginf0_.ACCOUNT_NUMBER as ACCOUNT4_32_0_, bankinginf0_.ORIGINATOR_NUMBER as ORIGINATOR5_32_0_, bankinginf0_.WITHDRAWAL_DAY as WITHDRAWAL6_32_0_, bankinginf0_.CREATED_BY as CREATED7_32_0_, bankinginf0_.MODIFIED_BY as MODIFIED8_32_0_, bankinginf0_.CREATED_DATE as CREATED9_32_0_, bankinginf0_.MODIFIED_DATE as MODIFIED10_32_0_, bankinginf0_.BILLING_ACCOUNT_ID as BILLING11_32_0_, bankinginf0_.EFFECTIVE_DATE as EFFECTIVE12_32_0_, bankinginf0_.TERMINATION_DATE as TERMINA13_32_0_ from BANKING_INFO bankinginf0_ where bankinginf0_.BILLING_ACCOUNT_ID=? order by bankinginf0_.EFFECTIVE_DATE desc
Hibernate: select billingpre0_.BILLING_ACCOUNT_ID as BILLING11___, billingpre0_.id as id__, billingpre0_.id as id2_, billingpre0_.BILLING_METHOD_TYPE as BILLING2_23_2_, billingpre0_.EFFECTIVE_DATE as EFFECTIVE3_23_2_, billingpre0_.TERMINATION_DATE as TERMINAT4_23_2_, billingpre0_.CORRESPONDENCE_TYPE as CORRESPO5_23_2_, billingpre0_.MAIL_INVOICE_IND as MAIL6_23_2_, billingpre0_.CREATED_BY as CREATED7_23_2_, billingpre0_.MODIFIED_BY as MODIFIED8_23_2_, billingpre0_.CREATED_DATE as CREATED9_23_2_, billingpre0_.MODIFIED_DATE as MODIFIED10_23_2_, billingpre0_.BILLING_ACCOUNT_ID as BILLING11_23_2_, billingpre0_.BILL_FREQUENCY_ID as BILL12_23_2_, billingpre0_.BILLING_CYCLE_ID as BILLING13_23_2_, billingfre1_.type_code as type1_0_, billingcyc2_.id as id1_, billingcyc2_.MONTH_OFFSET as MONTH2_20_1_, billingcyc2_.DUE_DAY as DUE3_20_1_, billingcyc2_.CYCLE_NAME as CYCLE4_20_1_ from BILLING_PREFERENCES billingpre0_, BILL_FREQUENCY_TYPE billingfre1_, BILLING_CYCLE billingcyc2_ where billingpre0_.BILL_FREQUENCY_ID=billingfre1_.type_code and billingpre0_.BILLING_CYCLE_ID=billingcyc2_.id and billingpre0_.BILLING_ACCOUNT_ID=? order by billingpre0_.EFFECTIVE_DATE desc
Hibernate: select paymentopt0_.BILLING_ACCOUNT_ID as BILLING10___, paymentopt0_.id as id__, paymentopt0_.id as id0_, paymentopt0_.REINSTATED as REINSTATED34_0_, paymentopt0_.PAYMENT_OPTION_ID as PAYMENT3_34_0_, paymentopt0_.CREATED_BY as CREATED4_34_0_, paymentopt0_.MODIFIED_BY as MODIFIED5_34_0_, paymentopt0_.CREATED_DATE as CREATED6_34_0_, paymentopt0_.MODIFIED_DATE as MODIFIED7_34_0_, paymentopt0_.REVOCATION_START_DATE as REVOCATION8_34_0_, paymentopt0_.REVOCATION_END_DATE as REVOCATION9_34_0_ from PAYMENT_OPT_REVOCATION paymentopt0_ where paymentopt0_.BILLING_ACCOUNT_ID=?
Hibernate: select monthlypay0_.BILLING_ACCOUNT_ID as BILLING1___, monthlypay0_.MONTHLY_PAYMENT_ID as MONTHLY2___, monthlypay1_.id as id0_, monthlypay1_.YEAR as YEAR27_0_, monthlypay1_.MONTH as MONTH27_0_, monthlypay1_.PAYMENT_AMOUNT as PAYMENT4_27_0_ from BILL_ACC_MONTHLY_PAY_XREF monthlypay0_, MONTHLY_PAYMENT monthlypay1_ where monthlypay0_.MONTHLY_PAYMENT_ID=monthlypay1_.id and monthlypay0_.BILLING_ACCOUNT_ID=?
Hibernate: update BILLING_ACCOUNT set BILLED_UP_TO_DATE=?, TERMINATION_DATE=?, EFFECTIVE_DATE=?, ACTIVE=?, OVERDUE_DATE=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=? where id=?
Hibernate: update BILLING_ACCOUNT_PAYOR set NAME=?, BILLING_ACCOUNT_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, ADDRESS_LINE1=?, ADDRESS_LINE2=?, ADDRESS_LINE3=?, CITY=?, PROVINCE=?, POSTAL_CODE=?, COUNTRY=? where id=?
Hibernate: update PAYMENT_OPT_REVOCATION set REINSTATED=?, PAYMENT_OPTION_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, REVOCATION_START_DATE=?, REVOCATION_END_DATE=? where id=?
2007-01-09 09:38:13,311;[DEBUG];ca.medavie.pb.billing.dao.hibernate.PaymentOptionUserType;- nullSafeSet:binding '2' to parameter: 2
Hibernate: update PAYMENT_OPT_REVOCATION set REINSTATED=?, PAYMENT_OPTION_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, REVOCATION_START_DATE=?, REVOCATION_END_DATE=? where id=?
2007-01-09 09:38:13,327;[DEBUG];ca.medavie.pb.billing.dao.hibernate.PaymentOptionUserType;- nullSafeSet:binding '2' to parameter: 2
Hibernate: update PAYMENT_OPT_REVOCATION set REINSTATED=?, PAYMENT_OPTION_ID=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, REVOCATION_START_DATE=?, REVOCATION_END_DATE=? where id=?

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject: A simplier version - unwanted updates when querying
PostPosted: Fri Jan 12, 2007 8:56 am 
Newbie

Joined: Tue Jan 09, 2007 10:52 am
Posts: 3
Refer to the mapping files in my first posting ...

I call my service via a JUnit, all the service does is call a DAO class that extends HibernateDAOSupport (I am using Spring as well), the DAO has the following code:

Code:
Object o = getHibernateTemplate().get( BillingAccount.class, accountId );


the log produced has the query, plus updates:

Hibernate: select billingacc0_.id as id0_, billingacc0_.BILLED_UP_TO_DATE as BILLED3_21_0_, billingacc0_.TERMINATION_DATE as TERMINAT4_21_0_, billingacc0_.EFFECTIVE_DATE as EFFECTIVE5_21_0_, billingacc0_.ACTIVE as ACTIVE21_0_, billingacc0_.OVERDUE_DATE as OVERDUE7_21_0_, billingacc0_.CREATED_BY as CREATED8_21_0_, billingacc0_.MODIFIED_BY as MODIFIED9_21_0_, billingacc0_.CREATED_DATE as CREATED10_21_0_, billingacc0_.MODIFIED_DATE as MODIFIED11_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_0_ from BILLING_ACCOUNT billingacc0_ where billingacc0_.id=?
Hibernate: select billablein0_.health_card_number as health1___, billablein0_.health_card_number as health1_0_, billablein0_.INCOME as INCOME35_0_, billablein0_.INCOME_TYPE as INCOME3_35_0_, billablein0_.INCOME_YEAR as INCOME4_35_0_, billablein0_1_.COMMON_FIRSTNAME as COMMON2_36_0_, billablein0_1_.COMMON_SURNAME as COMMON3_36_0_, billablein0_1_.BIRTH_DATE as BIRTH4_36_0_, billablein0_1_.GENDER as GENDER36_0_, billablein0_1_.SOCIAL_INSURANCE_NUMBER as SOCIAL6_36_0_, billablein0_1_.WORK_PHONE_NUMBER as WORK7_36_0_, billablein0_1_.HOME_PHONE_NUMBER as HOME8_36_0_, billablein0_1_.ARRIVAL_DATE as ARRIVAL9_36_0_, billablein0_1_.MOVED_FROM_INDICATOR as MOVED10_36_0_, billablein0_1_.MOVED_FROM_PROVINCE as MOVED11_36_0_, billablein0_1_.MOVED_TO_PROVINCE as MOVED12_36_0_, billablein0_1_.MOVED_FROM_CARD_NUMBER as MOVED13_36_0_, billablein0_1_.MOVED_TO_CARD_NUMBER as MOVED14_36_0_, billablein0_1_.DEPARTURE_DATE as DEPARTURE15_36_0_, billablein0_1_.INDIVIDUAL_NOTE as INDIVIDUAL16_36_0_, billablein0_1_.ALTERNATE_FIRSTNAME as ALTERNATE17_36_0_, billablein0_1_.ALTERNATE_SURNAME as ALTERNATE18_36_0_, billablein0_1_.CERTIFICATE_NUMBER as CERTIFI19_36_0_, billablein0_1_.APPLICATION_PRINT_DATE as APPLICA20_36_0_, billablein0_1_.APPLICATION_SENT_DATE as APPLICA21_36_0_, billablein0_1_.APPLICATION_PROCESSED_DATE as APPLICA22_36_0_, billablein0_1_.HEALTH_CARD_SEQ_NUMBER as HEALTH23_36_0_, billablein0_1_.RENEWAL_SENT_DATE as RENEWAL24_36_0_, billablein0_1_.RENEWAL_RECEIVED_DATE as RENEWAL25_36_0_, billablein0_1_.MODIFIED_BY as MODIFIED26_36_0_, billablein0_1_.LAST_MODIFIED as LAST27_36_0_, billablein0_1_.OLD_MSI_NUMBER as OLD28_36_0_, billablein0_1_.HEAD_OF_ADDRESS_LINK as HEAD29_36_0_ from senior billablein0_, individual billablein0_1_ where billablein0_.health_card_number=billablein0_1_.health_card_number and billablein0_.health_card_number=?
Hibernate: select bankinginf0_.BILLING_ACCOUNT_ID as BILLING11___, bankinginf0_.id as id__, bankinginf0_.id as id0_, bankinginf0_.BANK_NUMBER as BANK2_32_0_, bankinginf0_.BRANCH_NUMBER as BRANCH3_32_0_, bankinginf0_.ACCOUNT_NUMBER as ACCOUNT4_32_0_, bankinginf0_.ORIGINATOR_NUMBER as ORIGINATOR5_32_0_, bankinginf0_.WITHDRAWAL_DAY as WITHDRAWAL6_32_0_, bankinginf0_.CREATED_BY as CREATED7_32_0_, bankinginf0_.MODIFIED_BY as MODIFIED8_32_0_, bankinginf0_.CREATED_DATE as CREATED9_32_0_, bankinginf0_.MODIFIED_DATE as MODIFIED10_32_0_, bankinginf0_.BILLING_ACCOUNT_ID as BILLING11_32_0_, bankinginf0_.EFFECTIVE_DATE as EFFECTIVE12_32_0_, bankinginf0_.TERMINATION_DATE as TERMINA13_32_0_ from BANKING_INFO bankinginf0_ where bankinginf0_.BILLING_ACCOUNT_ID=? order by bankinginf0_.EFFECTIVE_DATE desc
Hibernate: select billingpre0_.BILLING_ACCOUNT_ID as BILLING11___, billingpre0_.id as id__, billingpre0_.id as id2_, billingpre0_.BILLING_METHOD_TYPE as BILLING2_23_2_, billingpre0_.EFFECTIVE_DATE as EFFECTIVE3_23_2_, billingpre0_.TERMINATION_DATE as TERMINAT4_23_2_, billingpre0_.CORRESPONDENCE_TYPE as CORRESPO5_23_2_, billingpre0_.MAIL_INVOICE_IND as MAIL6_23_2_, billingpre0_.CREATED_BY as CREATED7_23_2_, billingpre0_.MODIFIED_BY as MODIFIED8_23_2_, billingpre0_.CREATED_DATE as CREATED9_23_2_, billingpre0_.MODIFIED_DATE as MODIFIED10_23_2_, billingpre0_.BILLING_ACCOUNT_ID as BILLING11_23_2_, billingpre0_.BILL_FREQUENCY_ID as BILL12_23_2_, billingpre0_.BILLING_CYCLE_ID as BILLING13_23_2_, billingfre1_.type_code as type1_0_, billingcyc2_.id as id1_, billingcyc2_.MONTH_OFFSET as MONTH2_20_1_, billingcyc2_.DUE_DAY as DUE3_20_1_, billingcyc2_.CYCLE_NAME as CYCLE4_20_1_ from BILLING_PREFERENCES billingpre0_, BILL_FREQUENCY_TYPE billingfre1_, BILLING_CYCLE billingcyc2_ where billingpre0_.BILL_FREQUENCY_ID=billingfre1_.type_code and billingpre0_.BILLING_CYCLE_ID=billingcyc2_.id and billingpre0_.BILLING_ACCOUNT_ID=? order by billingpre0_.EFFECTIVE_DATE desc
Hibernate: select paymentopt0_.BILLING_ACCOUNT_ID as BILLING10___, paymentopt0_.id as id__, paymentopt0_.id as id0_, paymentopt0_.REINSTATED as REINSTATED34_0_, paymentopt0_.PAYMENT_OPTION_ID as PAYMENT3_34_0_, paymentopt0_.CREATED_BY as CREATED4_34_0_, paymentopt0_.MODIFIED_BY as MODIFIED5_34_0_, paymentopt0_.CREATED_DATE as CREATED6_34_0_, paymentopt0_.MODIFIED_DATE as MODIFIED7_34_0_, paymentopt0_.REVOCATION_START_DATE as REVOCATION8_34_0_, paymentopt0_.REVOCATION_END_DATE as REVOCATION9_34_0_ from PAYMENT_OPT_REVOCATION paymentopt0_ where paymentopt0_.BILLING_ACCOUNT_ID=?
Hibernate: select monthlypay0_.BILLING_ACCOUNT_ID as BILLING1___, monthlypay0_.MONTHLY_PAYMENT_ID as MONTHLY2___, monthlypay1_.id as id0_, monthlypay1_.YEAR as YEAR27_0_, monthlypay1_.MONTH as MONTH27_0_, monthlypay1_.PAYMENT_AMOUNT as PAYMENT4_27_0_ from BILL_ACC_MONTHLY_PAY_XREF monthlypay0_, MONTHLY_PAYMENT monthlypay1_ where monthlypay0_.MONTHLY_PAYMENT_ID=monthlypay1_.id and monthlypay0_.BILLING_ACCOUNT_ID=?
Hibernate: update BILLING_ACCOUNT set BILLED_UP_TO_DATE=?, TERMINATION_DATE=?, EFFECTIVE_DATE=?, ACTIVE=?, OVERDUE_DATE=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=? where id=?
Hibernate: update BILLING_PREFERENCES set BILLING_METHOD_TYPE=?, EFFECTIVE_DATE=?, TERMINATION_DATE=?, CORRESPONDENCE_TYPE=?, MAIL_INVOICE_IND=?, CREATED_BY=?, MODIFIED_BY=?, CREATED_DATE=?, MODIFIED_DATE=?, BILL_FREQUENCY_ID=?, BILLING_CYCLE_ID=? where id=?
2007-01-12 08:52:41,475;[DEBUG];ca.medavie.pb.billing.dao.hibernate.BillingMethodUserType;- nullSafeSet:binding '1' to parameter: 1


When I change the DAO to use getSession (which is frowned upon) as follows:

Code:
Object o = getSession().get( BillingAccount.class, accountId );


the log produced does NOT have the updates:

Hibernate: select billingacc0_.id as id0_, billingacc0_.BILLED_UP_TO_DATE as BILLED3_21_0_, billingacc0_.TERMINATION_DATE as TERMINAT4_21_0_, billingacc0_.EFFECTIVE_DATE as EFFECTIVE5_21_0_, billingacc0_.ACTIVE as ACTIVE21_0_, billingacc0_.OVERDUE_DATE as OVERDUE7_21_0_, billingacc0_.CREATED_BY as CREATED8_21_0_, billingacc0_.MODIFIED_BY as MODIFIED9_21_0_, billingacc0_.CREATED_DATE as CREATED10_21_0_, billingacc0_.MODIFIED_DATE as MODIFIED11_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_21_0_, billingacc0_.ACCOUNT_TYPE as ACCOUNT2_0_ from BILLING_ACCOUNT billingacc0_ where billingacc0_.id=?
Hibernate: select billablein0_.health_card_number as health1___, billablein0_.health_card_number as health1_0_, billablein0_.INCOME as INCOME35_0_, billablein0_.INCOME_TYPE as INCOME3_35_0_, billablein0_.INCOME_YEAR as INCOME4_35_0_, billablein0_1_.COMMON_FIRSTNAME as COMMON2_36_0_, billablein0_1_.COMMON_SURNAME as COMMON3_36_0_, billablein0_1_.BIRTH_DATE as BIRTH4_36_0_, billablein0_1_.GENDER as GENDER36_0_, billablein0_1_.SOCIAL_INSURANCE_NUMBER as SOCIAL6_36_0_, billablein0_1_.WORK_PHONE_NUMBER as WORK7_36_0_, billablein0_1_.HOME_PHONE_NUMBER as HOME8_36_0_, billablein0_1_.ARRIVAL_DATE as ARRIVAL9_36_0_, billablein0_1_.MOVED_FROM_INDICATOR as MOVED10_36_0_, billablein0_1_.MOVED_FROM_PROVINCE as MOVED11_36_0_, billablein0_1_.MOVED_TO_PROVINCE as MOVED12_36_0_, billablein0_1_.MOVED_FROM_CARD_NUMBER as MOVED13_36_0_, billablein0_1_.MOVED_TO_CARD_NUMBER as MOVED14_36_0_, billablein0_1_.DEPARTURE_DATE as DEPARTURE15_36_0_, billablein0_1_.INDIVIDUAL_NOTE as INDIVIDUAL16_36_0_, billablein0_1_.ALTERNATE_FIRSTNAME as ALTERNATE17_36_0_, billablein0_1_.ALTERNATE_SURNAME as ALTERNATE18_36_0_, billablein0_1_.CERTIFICATE_NUMBER as CERTIFI19_36_0_, billablein0_1_.APPLICATION_PRINT_DATE as APPLICA20_36_0_, billablein0_1_.APPLICATION_SENT_DATE as APPLICA21_36_0_, billablein0_1_.APPLICATION_PROCESSED_DATE as APPLICA22_36_0_, billablein0_1_.HEALTH_CARD_SEQ_NUMBER as HEALTH23_36_0_, billablein0_1_.RENEWAL_SENT_DATE as RENEWAL24_36_0_, billablein0_1_.RENEWAL_RECEIVED_DATE as RENEWAL25_36_0_, billablein0_1_.MODIFIED_BY as MODIFIED26_36_0_, billablein0_1_.LAST_MODIFIED as LAST27_36_0_, billablein0_1_.OLD_MSI_NUMBER as OLD28_36_0_, billablein0_1_.HEAD_OF_ADDRESS_LINK as HEAD29_36_0_ from senior billablein0_, individual billablein0_1_ where billablein0_.health_card_number=billablein0_1_.health_card_number and billablein0_.health_card_number=?
Hibernate: select bankinginf0_.BILLING_ACCOUNT_ID as BILLING11___, bankinginf0_.id as id__, bankinginf0_.id as id0_, bankinginf0_.BANK_NUMBER as BANK2_32_0_, bankinginf0_.BRANCH_NUMBER as BRANCH3_32_0_, bankinginf0_.ACCOUNT_NUMBER as ACCOUNT4_32_0_, bankinginf0_.ORIGINATOR_NUMBER as ORIGINATOR5_32_0_, bankinginf0_.WITHDRAWAL_DAY as WITHDRAWAL6_32_0_, bankinginf0_.CREATED_BY as CREATED7_32_0_, bankinginf0_.MODIFIED_BY as MODIFIED8_32_0_, bankinginf0_.CREATED_DATE as CREATED9_32_0_, bankinginf0_.MODIFIED_DATE as MODIFIED10_32_0_, bankinginf0_.BILLING_ACCOUNT_ID as BILLING11_32_0_, bankinginf0_.EFFECTIVE_DATE as EFFECTIVE12_32_0_, bankinginf0_.TERMINATION_DATE as TERMINA13_32_0_ from BANKING_INFO bankinginf0_ where bankinginf0_.BILLING_ACCOUNT_ID=? order by bankinginf0_.EFFECTIVE_DATE desc
Hibernate: select billingpre0_.BILLING_ACCOUNT_ID as BILLING11___, billingpre0_.id as id__, billingpre0_.id as id2_, billingpre0_.BILLING_METHOD_TYPE as BILLING2_23_2_, billingpre0_.EFFECTIVE_DATE as EFFECTIVE3_23_2_, billingpre0_.TERMINATION_DATE as TERMINAT4_23_2_, billingpre0_.CORRESPONDENCE_TYPE as CORRESPO5_23_2_, billingpre0_.MAIL_INVOICE_IND as MAIL6_23_2_, billingpre0_.CREATED_BY as CREATED7_23_2_, billingpre0_.MODIFIED_BY as MODIFIED8_23_2_, billingpre0_.CREATED_DATE as CREATED9_23_2_, billingpre0_.MODIFIED_DATE as MODIFIED10_23_2_, billingpre0_.BILLING_ACCOUNT_ID as BILLING11_23_2_, billingpre0_.BILL_FREQUENCY_ID as BILL12_23_2_, billingpre0_.BILLING_CYCLE_ID as BILLING13_23_2_, billingfre1_.type_code as type1_0_, billingcyc2_.id as id1_, billingcyc2_.MONTH_OFFSET as MONTH2_20_1_, billingcyc2_.DUE_DAY as DUE3_20_1_, billingcyc2_.CYCLE_NAME as CYCLE4_20_1_ from BILLING_PREFERENCES billingpre0_, BILL_FREQUENCY_TYPE billingfre1_, BILLING_CYCLE billingcyc2_ where billingpre0_.BILL_FREQUENCY_ID=billingfre1_.type_code and billingpre0_.BILLING_CYCLE_ID=billingcyc2_.id and billingpre0_.BILLING_ACCOUNT_ID=? order by billingpre0_.EFFECTIVE_DATE desc
Hibernate: select paymentopt0_.BILLING_ACCOUNT_ID as BILLING10___, paymentopt0_.id as id__, paymentopt0_.id as id0_, paymentopt0_.REINSTATED as REINSTATED34_0_, paymentopt0_.PAYMENT_OPTION_ID as PAYMENT3_34_0_, paymentopt0_.CREATED_BY as CREATED4_34_0_, paymentopt0_.MODIFIED_BY as MODIFIED5_34_0_, paymentopt0_.CREATED_DATE as CREATED6_34_0_, paymentopt0_.MODIFIED_DATE as MODIFIED7_34_0_, paymentopt0_.REVOCATION_START_DATE as REVOCATION8_34_0_, paymentopt0_.REVOCATION_END_DATE as REVOCATION9_34_0_ from PAYMENT_OPT_REVOCATION paymentopt0_ where paymentopt0_.BILLING_ACCOUNT_ID=?
Hibernate: select monthlypay0_.BILLING_ACCOUNT_ID as BILLING1___, monthlypay0_.MONTHLY_PAYMENT_ID as MONTHLY2___, monthlypay1_.id as id0_, monthlypay1_.YEAR as YEAR27_0_, monthlypay1_.MONTH as MONTH27_0_, monthlypay1_.PAYMENT_AMOUNT as PAYMENT4_27_0_ from BILL_ACC_MONTHLY_PAY_XREF monthlypay0_, MONTHLY_PAYMENT monthlypay1_ where monthlypay0_.MONTHLY_PAYMENT_ID=monthlypay1_.id and monthlypay0_.BILLING_ACCOUNT_ID=?


The query is not part of a transaction ... can anybody please explain to me what is going on here, this is really taking a toll on performance as well as affecting triggers that archive data when updates are made.... if you want credits, I will give max credits for help on this...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 1:23 pm 
Newbie

Joined: Tue Feb 14, 2006 5:13 am
Posts: 18
i didn't dig too deep into your mapping file, but i had such mysterious updates because of a setter method, that did not just update the property it is responsible for. this lead to the situation, that my pojo was "dirty" as soon as hibernate did initilize the entity by calling the invalid setter method, followed by an update with the next flush.

after separation of setter-functionality for hibernate from those that have pojo-functionality the updates disappeared.

this doesn't explain why it works without the hibernte-template, but maybe that's your problem too.

hope that helps,
andi


Top
 Profile  
 
 Post subject: correct
PostPosted: Wed Jan 17, 2007 9:11 am 
Newbie

Joined: Tue Jan 09, 2007 10:52 am
Posts: 3
Hi,

Thanks for the response, we came to the same conclusion through a painful process of stepping through the Hibernate code that compares objects to see if they are dirty. I had a couple setters that truncated usernames. You would think if your getter matched that there would be no issue, however this is not the case. I gave you credit anyway, thanks again for validating.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 17, 2007 9:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
how can you think hibernate will know magically that you object is not-dirty when your getter is returning som different value than the value used when set was called ? :)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.