shopware icon indicating copy to clipboard operation
shopware copied to clipboard

Multiple Database Connection per Request

Open mitelg opened this issue 2 years ago • 2 comments

At the moment, we build up multiple data connection to MySQL. This lead to too many connections and moreover an overhead for building up the connections.

Instead of creating a connection with

We should just use only one of these.

mitelg avatar Sep 20 '23 11:09 mitelg

the first one is in the DI container as "db_connection" and is a PDO connection. the second is the "dbal_connection" and is a DBAL connection. so those two could not be unified, as this would result in a break. because the services behave not the same and have different methods.

the connection in the auth plugin is also a PDO connection, which may be used with the one, created in the kernel. but I don't know if this was done on purpose because of session locking?

possible solution: using the PDO connection from the kernel, to create the DBAL connection

mitelg avatar Sep 20 '23 11:09 mitelg

@mitelg I think the current implementation was due session locking i remember we had some problems with it caused by a plugin

kayaArvatis avatar Mar 07 '24 08:03 kayaArvatis