"created" => new \pq\DateTime("tomorrow"),
"counter" => "1",
"number" => "1.1",
- "data" => "tomorrow"
+ "data" => "tomorrow",
+ "list" => array(1,2,3),
+ "prop" => null
),
$row->getData()
);
}
function testPessimisticLock() {
- $this->table->setLock(new Table\PessimisticLock);
+ $this->table->attach(new Table\PessimisticLock);
$txn = $this->table->getConnection()->startTransaction();
$row = $this->table->find(null, null, 1)->current();
$row->data = "foo";
}
function testPessimisticLockFail() {
- $this->table->setLock(new Table\PessimisticLock);
+ $this->table->attach(new Table\PessimisticLock);
$txn = $this->table->getConnection()->startTransaction();
$row = $this->table->find(null, null, 1)->current();
$row->data = "foo";
}
function testOptimisticLock() {
- $this->table->setLock(new Table\OptimisticLock("counter"));
+ $this->table->attach(new Table\OptimisticLock("counter"));
$row = $this->table->find(null, null, 1)->current();
$cnt = $row->counter->get();
$row->data = "foo";
}
function testOptimisticLockFail() {
- $this->table->setLock(new Table\OptimisticLock("counter"));
+ $this->table->attach(new Table\OptimisticLock("counter"));
$row = $this->table->find(null, null, 1)->current();
$row->data = "foo";
executeInConcurrentTransaction(