Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving data after rollback will throw an exception #1034

Open
Montaro2017 opened this issue Nov 23, 2023 · 0 comments
Open

Retrieving data after rollback will throw an exception #1034

Montaro2017 opened this issue Nov 23, 2023 · 0 comments

Comments

@Montaro2017
Copy link

Montaro2017 commented Nov 23, 2023

versioin

3.0.10

code

String name = "user";
User admin = new User().setUserName("admin");
Atomic.Var<Object> var = db.atomicVar(name).createOrOpen();
User user = (User) var.get();
// user should be null
Assertions.assertNull(user);

// set AtomicVar
var.set(admin);
user = (User) var.get();
Assertions.assertEquals(admin, user);

// rollback and get will throw exception
db.rollback();
user = (User) var.get();

It throw an exception in line user = (User) var.get(); after rollback

org.mapdb.DBException$GetVoid: Record does not exist, recid=10

	at org.mapdb.StoreWAL.getIndexVal(StoreWAL.kt:170)
	at org.mapdb.StoreWAL.get(StoreWAL.kt:500)
	at org.mapdb.Atomic$Var.get(Atomic.java:751)
	at com.mapdbtest.DBServiceTest.testRollback(DBServiceTest.java:110)
@Montaro2017 Montaro2017 changed the title After rollback will throw exception Retrieving data after rollback will throw an exception Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant