Fix currentTransaction in references while using query

This commit is contained in:
2024-05-06 20:50:29 +02:00
parent 68562160f1
commit 7eda90d30d
10 changed files with 136 additions and 133 deletions

View File

@@ -1,12 +1,12 @@
package nl.astraeus.persistence
import nl.astraeus.nl.astraeus.persistence.OptimisticLockingException
import nl.astraeus.nl.astraeus.persistence.Persistable
import nl.astraeus.nl.astraeus.persistence.Persistent
import nl.astraeus.nl.astraeus.persistence.TransactionLog
import nl.astraeus.nl.astraeus.persistence.find
import nl.astraeus.nl.astraeus.persistence.findByIndex
import nl.astraeus.nl.astraeus.persistence.index
import nl.astraeus.persistence.domain.Person
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.assertThrows
import java.io.File
@@ -14,21 +14,6 @@ import kotlin.test.Test
class TestOptimisticLocking {
class Person(
override var id: Long = 0,
override var version: Long = 0,
val name: String,
val age: Int,
) : Persistable, Cloneable {
companion object {
private const val serialVersionUID: Long = 1L
}
override fun toString(): String {
return "Person(id=$id, version=$version, name='$name', age=$age)"
}
}
@Test
fun showTransactions() {
val log = TransactionLog(File("data", "test-locking"))