0

I have a legacy application which we began to reflector with PDO but we have a giant chunk of code with is starting a transaction in mysql_connect query with START TRANSACTION.

Now my problem it seems is that the data does not get read correctly from the PDO connection from the database.

We have like 50 inserts in this giant transaction and it seems like some of them don't get read from the PDO while the transaction is still in progress...

How can I make PDO so it shares the same transaction?

We use mysql 5.1.49 version. PHP/5.3.3-7+squeeze19

I have googled many threads about it but without success:

http://www.thedevfiles.com/2014/08/moving-from-mysql-query-to-pdo

Getting a PHP PDO connection from a mysql_connect()?

Community
  • 1
  • 1
Sangoku
  • 1,588
  • 2
  • 21
  • 50
  • Are you using more than 1 connection to the db at the same time from PDO? Then the other connection won't see data in uncommited transaction. Think if you need all of that inserts to be part of one giant transaction... – Marki555 Jun 23 '15 at 14:39
  • That is my question how can i share the same connection, as far i know it is imposible to use the same connection with both connection types... – Sangoku Jun 23 '15 at 20:04

0 Answers0