Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D DataEngineering
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Diese GitLab Instanz ist nicht für den produktiven Einsatz gedacht!
Bitte https://gitlab.ost.ch benutzen!
Diese Instanz ist nur nuch zur Datenmigration online.

Vielen Dank für euer Verständnis.

  • Lehre und Unterricht
  • Datenbank- und Informations-Systeme
  • DataEngineering
  • Issues
  • #14

Closed
Open
Created Mar 02, 2017 by Marcel Huber@m1huberOwner

Improve solution for OR-Mapper_JPA_ff: Exercise 5

Context

OR-Mapper_JPA_ff

Summary

The current solution is not matching the exercises goals and is not a good one too. Using em.lock(from, LockModeType.PESSIMISTIC_WRITE); does not guarantee that we can not get lost updates. Even worse, we encounter locked transactions when using a different sequence of commands.

Steps to reproduce

(How one can reproduce the issue - this is very important)

What is the current issue behavior?

(What actually happens)

What is the expected correct behavior?

(What you should see instead)

Relevant logs and/or screenshots

(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)

Possible fixes

Use @Version for the accounting entity and try using a Timestamp as value. Maybe we can create/update the table within code using a dynamic query.

Links

  • Lost updates and locking: https://vladmihalcea.com/2014/09/14/a-beginners-guide-to-database-locking-and-the-lost-update-phenomena/
  • JPA and locking: http://www.developer.com/java/manage-concurrent-access-to-jpa-entity-with-locking.html
  • JPA entity versioning @Version: http://www.byteslounge.com/tutorials/jpa-entity-versioning-version-and-optimistic-locking
  • Explicit locking: https://www.dynatrace.com/blog/week-38-transactions-in-a-jpa-world/
Edited Mar 08, 2018 by Marcel Huber
Assignee
Assign to
Time tracking