我尝试将一些实体保存到我的mysql数据库中,日志在此日志后立即停止:
提示:通过保存另一个实体,一切正常。这就是我认为连接本身等等没问题的原因。通过getQuery() - > getResult()读取数据是没有问题的
[2013-09-18 14:25:30] app.INFO: A62 wird persistiert [] []
[2013-09-18 14:25:31] app.INFO: A62 persistiert [] []
[2013-09-18 14:25:31] app.INFO: Before Flush [] []
[2013-09-18 14:25:31] doctrine.DEBUG: "START TRANSACTION" [] []
这是相应的控制器代码(略微缩短):
$immo = new \namespace\MainBundle\Entity\Sale();
$immo->setTitle($bla);
$logger->info($immo->getTitle() . " wird persistiert");
try {
$em->persist($immo);
$logger->info($immo->getTitle() . " persistiert");
} catch (Exception $e) {
$logger->err($immo->getTitle()." Error : ".$e->getMessage());
}
...
$logger->info("Before Flush");
$em->flush();
$logger->info("After Flush");
实体
/**
* @ORM\Table(name="mySaleTableName")
* @ORM\Entity(repositoryClass="Namespace\MainBundle\Entity\SaleRepository")
*/
class Sale extends BaseImmobilie
{
}
class BaseImmobilie
{
/**
* @ORM\Id
* @ORM\Column(type="smallint")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="text")
*/
protected $title;
public function getId() { return $this->id; }
public function setId($x) { $this->id = $x; }
public function getTitle() { return $this->art; }
public function setTitle($x) { $this->art = $x; }
}
显示完整的流程列表
Id User Host db Command Time State Info
8528653 dbo441722318 10.46.135.38:55451 NULL Sleep 0 NULL
8528654 dbo441722318 10.46.135.38:55452 db441722318 Query 0 NULL show full processlist
找到了一些东西(现在我可以纠正我的错误)
Fatal error: Call to a member function format() on a non-object in /homepages/8/d90136514/htdocs/symfony/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/DateType.php on line 44