Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the hjmpts column in hybris for?

I have a Hybris system and in every database table there is a column named "hjmpts". The column contains INT values. Does someone know reason for this column?

like image 712
Christoph Avatar asked Mar 09 '23 03:03

Christoph


1 Answers

It's meant to support optimistic locking in the same way as a persistence layer like Hibernate does with a @Version annotation.

Basically when you select a row with from the database and that returns you the current version. When the row is updated then the version column is incremented. When you update the row you use a WHERE clause on the query to match the version that you selected. If the update doesn't modify any rows then you know something else has updated the row (and version) in the meantime.

hjmp.throw.concurrent.modification.exceptions(default false) is config parameter which either enables or disables checking that upon update a item row must have the same version that has been read when fetching the HJMP entity object.

This means setting hjmp.throw.concurrent.modification.exceptions parameter to true in properties activates optimistic locking and of course increasing the risk of seeing optimistic concurrency exceptions such as HJMPException(PK was modified concurrently - expected version ... ), which will force a transaction rollback


P.S: If you don't enable optimistic locking, only the dirty attributes will be written and the final result will be a merge.

like image 69
Vikrant Avatar answered Apr 25 '23 20:04

Vikrant