[Flow] Deadlock using RestService
Regine Rosewich
regine.rosewich at hoellenberg.biz
Wed Jul 23 13:40:26 CEST 2014
Hi Alexander,
did you try to explicitly persist the transaction?
($this->persistenceManager->persistAll())
Regine Rosewich
Am 23.07.14 12:40 schrieb "Alexander Wende" unter <a_wende at web.de>:
>I implemented the raptor editor (www.raptor-editor.com) to allow my users
>comfortable editing of a page model.
>When the raptor editor saves the changes, it fires for every changed
>property an updatePageAction.
>
>My updatePageAction looks like this (atm it can only update the title or
>content property of the page object)
> /**
> * @param \COMPANY\Page\Domain\Model\Page $page
> * @param string $id the identifier for the modified property
> * @param string $content the new value of the modified property
> */
> public function updatePageAction(\COMPANY\Page\Domain\Model\Page
>$page,$id,$content){
> switch ($id){
> case 'content':
> $page->setContent($content);
> break;
> case 'title':
> $page->setTitle($content);
> break;
> }
> $this->pageRepository->update($page);
> return json_encode(true);
>
>When I update only one property it works fine. But when I try to change
>title and content, the raptor editor fires two Request very fast. The
>first request is allways succesful. The second request failed every time
>with the Exception "SQLSTATE[40001]: Serialization failure: 1213 Deadlock
>found when trying to get lock; try restarting transaction"
>
>Is there a better way to build such RestServices?
>
>_______________________________________________
>Flow mailing list
>Flow at lists.typo3.org
>http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list