Yes, that is probably the reason. You must not call persist (or other methods of the PersistentActor) from other threads, such as future callbacks.
On Wed, Jan 6, 2016 at 1:26 PM, <[email protected]> wrote: > persist wasn't called from a constructor. Sorry, I should have shown this > function definition too. > > ``` > def performIfActorNotLive(ar: ActorRef, f: => Unit) = { > implicit val timeout = Timeout(Duration.create(5, TimeUnit.SECONDS)) > try { > (ar ? Identify(1)).mapTo[ActorIdentity].map { aid ⇒ > if (aid.ref.isEmpty) f > } > } catch { > case e: Throwable ⇒ > } > } > ``` > > Here `f` is `persistAndUpdate`, which internally calls the `persist` > method. As you can see, the persist is being called from a future callback. > I felt that this might have caused the ClassCastException and refactored it > to send a command to self. Do you think that's what caused it? > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
