Hibernate versioning releases update for no reason

My hibernate version control is issuing an update statement for no apparent reason.

In the mapping file BankAccount:

<version type="dbtimestamp" name="modified" column="Modified"/>

      

in the AvailableBalance mapping file:

<many-to-one name="bankAccount" class="model.businessdomain.orm.BankAccount" fetch="select" >
   <column name="BankAccountId" not-null="true" />
</many-to-one>

      

The resulting sql statements issued when a selection is made from the AvailableBalance table (via a function):

17:12:16,152 DEBUG SQL:401 - select * from dbo.get_availablebalancelist(?) ab  where ab.bankAccountId = ?
17:12:31,539 DEBUG SQL:401 - select current_timestamp
17:12:31,625 DEBUG SQL:401 - update dbo.BankAccount set Modified=?, BankAccountTypeId=?, BankID=?, InterestSchemeID=?, BankAccNo=?, SysParamID=?, BankAccName=?, BranchCode=?, UserRef=?, CAMSCode=?, Provision=?, ProvisionPerc=?, OverDraftLimit=?, isIslamic=?, Active=? where BankAccountId=? and Modified=?

      

+1


a source to share


2 answers


Is the object changed in memory in any way after the selection? If an object is marked dirty, depending on the transaction strategy, a commit may occur, which could be an implicit database update.



0


a source


The reason for this update is most likely not the code you posted.



To debug it, you can set a breakpoint in your logger and look at the stack that issues this assertion.

0


a source







All Articles