[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jfw] Re: Joomla PDO Database Driver



I have no problem connecting to multiple databases at all. That is not what I said.

There can be problems connecting to the same database in different ways concurrently. For instance using pdo and mysqli on the same database at the same time. See for instance http://stackoverflow.com/questions/22671730/is-it-okay-to-mix-pdo-and-mysqli.
Besides the problems that could occur in this way, you also use 2 database connections where 1 would be sufficient. When you have a high-traffic site, that is an unnecessary (and maybe even fatal) load.

Why would you use those two connections for one database at the same time? When you are making extensions for the Joomla CMS an want to use Doctrine in it (like I do). You need the mysqli-connection to run Joomla and I always used pdo (as everybody does) to run Doctrine. Now Ihave not encountered problems with that the last years, and it was running on production sites, not just some tests. But as outlined above, there can be connection problems and unnecessary overload. I'm using the same database; sometimes even the same tables (for instance the users-table etc).

My solution was: to look at a pdo_mysql connection for Joomla. That is still my preferred solution, as I prefer pdo above mysqli (but that's a different discussion). Fron this thread I learned that you can also use mysqli as connection in Doctrine. That avoids problems that could occur when mixing pdo and mysqli (I once read somewhare that some mysqli-commands don't work well if immediately issued after having used pdo to the same db).

--
Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
---
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.