Stateless getInsertSQL() #7152

Closed
opened 2026-01-22 15:45:41 +01:00 by admin · 1 comment
Owner

Originally created by @PsmaDev on GitHub (May 18, 2023).

Sorry, I think I did not explane correctly issue https://github.com/doctrine/orm/issues/10709
I change table prefix in middelware during each reqest, and it works perfect with UPDATE and SELECT.
Problem cause getInsertSQL() has check
if ($this->insertSql !== null) { return $this->insertSql; }
So, it sets once and next requests keeps the same, If i check methodata it is ok, it's changed.

Originally created by @PsmaDev on GitHub (May 18, 2023). Sorry, I think I did not explane correctly issue https://github.com/doctrine/orm/issues/10709 I change table prefix in middelware during each reqest, and it works perfect with UPDATE and SELECT. Problem cause getInsertSQL() has check `if ($this->insertSql !== null) { return $this->insertSql; }` So, it sets once and next requests keeps the same, If i check methodata it is ok, it's changed.
admin closed this issue 2026-01-22 15:45:41 +01:00
Author
Owner

@beberlei commented on GitHub (May 18, 2023):

You described the problem perfectly well, but as I mentioned changing the metadata of a class after the EntityManager was used is just not supported. This has nothing to do with UDPATE and SELECT working.

Please stop opening new issues for this. You need to find another solution for your use-case.

@beberlei commented on GitHub (May 18, 2023): You described the problem perfectly well, but as I mentioned changing the metadata of a class after the EntityManager was used is just not supported. This has nothing to do with UDPATE and SELECT working. Please stop opening new issues for this. You need to find another solution for your use-case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7152