diff --git a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala index e44851ccc4..ed07741e6b 100644 --- a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala +++ b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala @@ -293,7 +293,7 @@ trait PersistentMap[K, V] extends scala.collection.mutable.Map[K, V] protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException - transaction.get.get.register(uuid, this) + transaction.get.get.register("Map:" + uuid, this) } } @@ -551,7 +551,7 @@ trait PersistentVector[T] extends IndexedSeq[T] with Transactional with Committa protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException - transaction.get.get.register(uuid, this) + transaction.get.get.register("Vector" + uuid, this) } } @@ -589,7 +589,7 @@ trait PersistentRef[T] extends Transactional with Committable with Abortable { protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException - transaction.get.get.register(uuid, this) + transaction.get.get.register("Ref" + uuid, this) } } @@ -712,7 +712,7 @@ trait PersistentQueue[A] extends scala.collection.mutable.Queue[A] protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException - transaction.get.get.register(uuid, this) + transaction.get.get.register("Queue:" + uuid, this) } } @@ -827,7 +827,7 @@ trait PersistentSortedSet[A] extends Transactional with Committable with Abortab val es = replay // a multimap with key as A and value as Set of scores - val m = new collection.mutable.HashMap[A, collection.mutable.Set[Float]] + val m = new collection.mutable.HashMap[A, collection.mutable.Set[Float]] with collection.mutable.MultiMap[A, Float] for(e <- es) m.addBinding(e._1, e._2) @@ -851,7 +851,7 @@ trait PersistentSortedSet[A] extends Transactional with Committable with Abortab protected def register = { if (transaction.get.isEmpty) throw new NoTransactionInScopeException - transaction.get.get.register(uuid, this) + transaction.get.get.register("SortedSet:" + uuid, this) } } diff --git a/akka-stm/src/main/scala/stm/Transaction.scala b/akka-stm/src/main/scala/stm/Transaction.scala index 0fa38a0ff9..880a0af05a 100644 --- a/akka-stm/src/main/scala/stm/Transaction.scala +++ b/akka-stm/src/main/scala/stm/Transaction.scala @@ -142,7 +142,8 @@ object Transaction { private[akka] def decrement = depth.decrementAndGet private[akka] def isTopLevel = depth.get == 0 - + //when calling this method, make sure to prefix the uuid with the type so you + //have no possibility of kicking a diffferent type with the same uuid out of a transction private[akka] def register(uuid: String, storage: Committable with Abortable) = persistentStateMap.put(uuid, storage) private def ensureIsActive = if (status != TransactionStatus.Active)