Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@katzyn
Copy link
Contributor

@katzyn katzyn commented Jul 2, 2023

No description provided.

Copy link
Contributor

@grandinj grandinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, now we can build a message queue using H2 :-)

mapName = map.getName();
}
} while (transaction.waitFor(blockingTransaction, mapName, key));
} while (timeoutMillis != 0 && transaction.waitFor(blockingTransaction, mapName, key, timeoutMillis));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeoutMillis != -1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is used for NOWAIT, with NOWAIT we shouldn't wait for anything and loop needs to be aborted.

-1 is used for plain FOR UPDATE and Transaction.waitFor() uses its own default timeout (taken from the session).

@katzyn katzyn merged commit 578cb6d into h2database:master Jul 3, 2023
@katzyn katzyn deleted the for_update branch July 3, 2023 03:03
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

Successfully merging this pull request may close these issues.

2 participants