Created
May 2, 2016 22:52
-
-
Save eishay/11d8635392156f72fee21018e1ff4e53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.readOnly { implicit s => | |
// only reading from db - not in a transaction | |
} | |
db.readWrite { implicit s => | |
// reading and writing to db in a transaction | |
} | |
db.readWrite(3) { implicit s => | |
// reading and writing to db in a transaction with retries if a database | |
// exception is thrown (up to 3 attempts total) by rolling back the | |
// transaction, starting a new one, and re-executing the block. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment