Symfony2 + Doctrine2 + SQL Server - Transaction Support

I am developing a private enterprise application in Symfony2 that connects to an instance of SQL Server. I had a lot of problems working with SQL Server, but so far I have dealt with this, so far. I use FreeTDS + DBLib to connect to an instance of SQL Server, and this driver does not support transactions. This leads me to the following problem:

Every time I try to save an object, Symfony (or Doctrine) complains:

request.CRITICAL: 
    PDOException: 
        This driver doesn't support transactions (uncaught exception) at /.../Doctrine/DBAL/Connection.php line 858

My first, although it was disabling transactions, because the data change that I do through the application is minimal. I searched this topic over the Doctrine documentation, but I could not find any relevant information.

So my question is: is there any workaround for this lack of transaction support (some configuration option or even editing the Doalrine DBAL source).

And: Would it be smoother to just switch to Propel? I read on my website that they support SQL Server and have documentation on how to configure Propel for proper use.

+3
source share
2 answers

This is a PDO exception that is thrown when trying to start a transaction in a non-transactional database through PDO :: beginTransaction ().

Doctrine typically processes transactions, queuing them up within the unit of work, and then writing them as one optimized flush () request.

, ( ), .

//UnitOfWork::commit($entity = null);
$conn->beginTransaction();

, , , -.

, , .

, Annotation, . , ORM, .

http://www.doctrine-project.org/jira/browse/DDC-972

+1

, , , , , . , DateTimeType :

\Doctrine\DBAL\Types\Type::overrideType(
    "datetime", 
    "Doctrine\DBAL\Types\VarDateTimeType"
);

\Doctrine\DBAL\Types\Type::overrideType(
    "date", 
    "Doctrine\DBAL\Types\VarDateTimeType"
);

dbal github project, , dblib - . , doctrine-dbal 2.1.6, 2.1.6-dblib, , dblib.

PDODblibBundle codebase . Connection BEGIN TRANSACTION, . .

0

All Articles