[midPoint-git] [Evolveum/midpoint] 3329ec: MID-9153: Sqale: Changed how locking in m_refresh_...

Tony Tkáčik noreply at github.com
Fri Sep 29 14:28:42 CEST 2023


  Branch: refs/heads/feature/sqale-closure-update
  Home:   https://github.com/Evolveum/midpoint
  Commit: 3329ec79893abf63d945bdb41d706ce2458fd795
      https://github.com/Evolveum/midpoint/commit/3329ec79893abf63d945bdb41d706ce2458fd795
  Author: Tony Tkáčik <tonydamage at gmail.com>
  Date:   2023-09-29 (Fri, 29 Sep 2023)

  Changed paths:
    M config/sql/native/postgres-upgrade.sql
    M config/sql/native/postgres.sql
    M repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/SqaleUtils.java

  Log Message:
  -----------
  MID-9153: Sqale: Changed how locking in m_refresh_org_closuer works

m_refresh_org_closure used double check mechanism with locks which
is common Java pattern:
 - check before locking if refresh is needed,
 - check after locking if refresh is still needed
 - do work

Which does not work correctly with PostgreSQL transaction guaranties
becouse once data are readed in transaction, logic states that
the value will be same for subsequent reads, that means second check
was always same as first.

The change is removing first check outside lock, so checks are doneň
only under lock.




More information about the midPoint-svn mailing list