-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Doctrine][Messenger] Fix Identity columns not supported by Oracle driver #58504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
#54566 does not (fully) solve this. Do I understand that correctly? |
@rjd22 FYI |
@xabbuh I don't have a very new Oracle version to test this on. But I would say unless they deprecated something my solution should solve this. Honestly using the user_sequences table to get the last id sounds like something that is not portable between different Oracle versions. Edit: checked but my changes are not yet in 6.12 |
@xabbuh : Yes. It doesn't solve the issue. Generated sequences always end with _seq (in my case anyway and if size not limited by config). And the request to get the ID ('SELECT '.$sequenceName.'.CURRVAL FROM DUAL') throws ORA-08002 error. @rjd22 : I do agree. Using the user_sequences table is pretty ugly but I don't have a better solution as sequenceName.currval is not supported. |
Well I would recommend doing some extended research what the new official way of getting currval is so I can check backwards compatibility. I cannot imagine it's using the user_sequences table. I don't have access to your Oracle version so I cannot do the research myself. |
My bad. 'SELECT '.$sequenceName.'.CURRVAL FROM DUAL' works like a charm 👍 . I was testing that request outside the current session. |
For the sequence name, the auto_setup create it by adding the suffix _seq to the table name. And so far, all generated sequences by doctrine have been set that way. Is there a reason for forcing it as prefix to the table name ? |
No reason except that prefixed sequences are an old Oracle default I fell back on. It might have changed in the years. Edit: I have no strong feelings about the prefixing or suffixing so if feel it's better to change it you're free to make an PR. |
You need to fork the symfony/symfony repository and make the changes in that fork not in your fork of the symfony/doctrine-messenger repository. |
Symfony version(s) affected
6.4.12
Description
Error Message
IdentityColumnsNotSupported > DriverException > TransportException : An exception occurred in the driver: The driver does not support identity columns.
Context
Usage of async symfony/messenger with doctrine as transport
Explanation
When dealing with an Oracle database, the dispatched message is well inserted into the database but an exception is encountered when trying to get the last inserted id. That exception lead to a rollback and therefore a failing process of queing the messages.
IDs are generated with sequence instead of identity column as you have it with MySQL database for exemple.
A specific treatment is needed as done for PostgreSQL database
How to reproduce
Environment
How to reproduce
When testing the async process, the error should appear as the message can't be recorded into the database
Stack-Traces.txt
Possible Solution
Target the OraclePlatform to get the last inserted id as needed for that database :
Important :
Additional Context
No response
The text was updated successfully, but these errors were encountered: