added monadic ops to TransactionalRef, fixed bug with nested txs

This commit is contained in:
jboner 2009-09-17 09:47:22 +02:00
parent 3be193904d
commit 2998fa4dbc
11 changed files with 265 additions and 231 deletions

View file

@ -28,10 +28,13 @@ case object LogSize
class BankAccountActor extends Actor {
makeTransactionRequired
private val accountState =
PersistentState.newMap(MongoStorageConfig())
private val txnLog =
PersistentState.newVector(MongoStorageConfig())
private var accountState: PersistentMap = _
private var txnLog: PersistentVector = _
override def initializeTransactionalState = {
accountState = PersistentState.newMap(MongoStorageConfig())
txnLog = PersistentState.newVector(MongoStorageConfig())
}
def receive: PartialFunction[Any, Unit] = {
// check balance