dpo
7. November 2018 um 10:52
1
Hi!
Es geht um JPA mit EclipseLink und MS SQL.
Es gibt so Fälle, da liefert eine JPA-Query, also ein Select, keine oder falsche Daten, wenn sie nicht ausdrücklich in einer Transaktion läuft.
Leider konnte ich nicht erfahren warum das so ist, den eigentlich müßte das mit AutoCommit abgehandelt sein. Hat jemand von euch eine Erklärung?
Danke!
maki
8. November 2018 um 11:12
3
dpo:
Es gibt so Fälle, da liefert eine JPA-Query, also ein Select, keine oder falsche Daten, wenn sie nicht ausdrücklich in einer Transaktion läuft.
Du meinst „Isolation Level“
In database systems, isolation determines how transaction integrity is visible to other users and systems.
A lower isolation level increases the ability of many users to access the same data at the same time, but also increases the number of concurrency effects (such as dirty reads or lost updates) users might encounter. Conversely, a higher isolation level reduces the types of concurrency effects that users may encounter, but requires more system resources and increases the chances that one tra...
In computer science, ACID (atomicity, consistency, isolation, durability) is a set of properties of database transactions intended to guarantee data validity despite errors, power failures, and other mishaps. In the context of databases, a sequence of database operations that satisfies the ACID properties (which can be perceived as a single logical operation on the data) is called a transaction. For example, a transfer of funds from one bank account to another, even involving multiple changes In...
1 „Gefällt mir“
dpo
8. November 2018 um 17:08
4
Danke für eure Antworten.
Im dem Fall war es ein grober Fehler von mir. Versehentlich habe ich eine Transaktion committet obwohl danach noch eine Query gekommen ist. Dank der Caches von EclipseLink sind die wildesten Ergebnisse beim testen herausgekommen. Ich werde mich mit den Caches mal etwas genauer beschäftigen müssen.
@maki
Danke für die Links. Obwohl bei mir die Datenbanken mit Serializable Transactions laufen ist es gut, dass die IsolationLevels wieder ins Gedächtnis gerufen wurden.