Created
October 7, 2014 16:23
-
-
Save spullara/5c34cd63cf2c2879763a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Override | |
public <T> T run(final Function<? super Transaction, T> tFunction) { | |
return database.run(new Function<Transaction, T>() { | |
int tries = 0; | |
@Override | |
public T apply(Transaction tx) { | |
if (tries++ > 0) { | |
log.info("Retrying transaction: " + tries); | |
} | |
setOptions(tx); | |
return tFunction.apply(tx); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment