diff --git a/akka-docs/rst/java/persistence.rst b/akka-docs/rst/java/persistence.rst index 7e2da4e589..48b70d73ef 100644 --- a/akka-docs/rst/java/persistence.rst +++ b/akka-docs/rst/java/persistence.rst @@ -326,6 +326,13 @@ In this case no stashing is happening, yet events are still persisted and callba While it is possible to nest mixed ``persist`` and ``persistAsync`` with keeping their respective semantics it is not a recommended practice, as it may lead to overly complex nesting. +.. warning:: + While it is possible to nest ``persist`` calls within one another, + it is *not* legal call ``persist`` from any other Thread than the Actors message processing Thread. + For example, it is not legal to call ``persist`` from Futures! Doing so will break the guarantees + that the persist methods aim to provide. Always call ``persist`` and ``persistAsync`` from within + the Actor's receive block (or methods synchronously invoked from there). + .. _failures-java: Failures diff --git a/akka-docs/rst/scala/persistence.rst b/akka-docs/rst/scala/persistence.rst index c724162707..cdc5d3788e 100644 --- a/akka-docs/rst/scala/persistence.rst +++ b/akka-docs/rst/scala/persistence.rst @@ -312,6 +312,13 @@ In this case no stashing is happening, yet events are still persisted and callba While it is possible to nest mixed ``persist`` and ``persistAsync`` with keeping their respective semantics it is not a recommended practice, as it may lead to overly complex nesting. +.. warning:: + While it is possible to nest ``persist`` calls within one another, + it is *not* legal call ``persist`` from any other Thread than the Actors message processing Thread. + For example, it is not legal to call ``persist`` from Futures! Doing so will break the guarantees + that the persist methods aim to provide. Always call ``persist`` and ``persistAsync`` from within + the Actor's receive block (or methods synchronously invoked from there). + .. _failures-scala: Failures