Skip to content
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

DBAL-680: [GH-428] [DBAL-563] Add interface for sequence emulated identity platforms #1902

Closed
doctrinebot opened this issue Nov 25, 2013 · 3 comments
Assignees
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of deeky666:

Url: #428

Message:

Currently identity columns on Oracle are implemented with a trigger and sequence workaround to be compatible with IDENTITY generator strategy in ORM. However, using this strategy, the last insert ID is never returned when persisting, as the sequence name generated by DBAL is not passed to the ID-Generator instance in ORM and thus not passed to the driver when calling IdentityGenerator::generate(). Therefore the Oracle driver always returns null in this case. This makes this strategy unusable.
A similar case is given in PostgreSQL where SERIAL identity columns need a sequence in order to work. There is a hackish implementation available in ORM for this case which makes it work.
It is possible that other vendors (when implemented) encounter the same issue. For this reason I tried to create a general solution with this PR.
ORM needs to know which platforms do not have native support for identity columns but can emulate them with sequences. To prepare this I added an interface that identifies a platform being able to do so. Platforms implementing this interface have to return the name of the sequence used for an identity column in a table. ORM can later make use of this and pass it to the IdentityGenerator so that the underlying driver in return is able to supply the last insert ID.
Current implementing platforms are PostgreSQL and Oracle.

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-428] was closed:
#428

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants