added init tx state hook for active objects, rewrote mongodb test

This commit is contained in:
jboner 2009-09-23 09:02:14 +02:00
parent 1bce709c5d
commit 98bdd9370d
17 changed files with 538 additions and 593 deletions

View file

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