Autonomous commit - commit single savepoint or transaction

28 views
Skip to first unread message

Mat M

unread,
Jul 23, 2021, 6:51:04 PM7/23/21
to H2 Database
I'm working on a legacy Java application using H2 to save and store data, and have to add an autonomous commit for a single record between savepoints.

The scenario is as follows:
1. screen 1 creates savepoint 1 and allows inserts/updates and rollback to savepoint 1
2. screen 2 accessed from screen 1 creates savepoint 2 and allows inserts/updates and rollback to savepoint 2
3. based on user action, each of the screens needs to be able to insert and commit a single row for auditing, without committing savepoint 1 or 2

Any suggestions how that can be achieved? Is there a way to commit a single savepoint instead of all, like you can roll back to a savepoint?

Note: I can't change how the screens work or redesign the application.

Noel Grandin

unread,
Jul 25, 2021, 2:27:46 AM7/25/21
to H2 Database

you're going to need to use two connections to achieve that
Reply all
Reply to author
Forward
0 new messages