DDC-3558: Sequence name generation for identity strategy #4375

Open
opened 2026-01-22 14:40:31 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 4, 2015).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user Gemorroj:

In version 2.5 added support sequence with the strategy of identity.
But I cannot get the correct name of the sequence with the strategy of identity. With the strategy sequence produces the correct name. It is taken from the configuration sequenceName. Strategy identity name sequence will not be taken from the configuration, and is always generated is automatically (which is not working properly in my case).

see: 4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L632)
the title sequence is generated automatically.

4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L662)
and in this case, it first checks its own configuration.

Originally created by @doctrinebot on GitHub (Feb 4, 2015). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user Gemorroj: In version 2.5 added support sequence with the strategy of identity. But I cannot get the correct name of the sequence with the strategy of identity. With the strategy sequence produces the correct name. It is taken from the configuration sequenceName. Strategy identity name sequence will not be taken from the configuration, and is always generated is automatically (which is not working properly in my case). see: https://github.com/doctrine/doctrine2/blob/4c68a38bd6b7d590dbfa90b2bb116129381935ce/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L632 the title sequence is generated automatically. https://github.com/doctrine/doctrine2/blob/4c68a38bd6b7d590dbfa90b2bb116129381935ce/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L662 and in this case, it first checks its own configuration.
admin added the Bug label 2026-01-22 14:40:31 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 5, 2015):

Comment created by Gemorroj:

Any comments plz..?

@doctrinebot commented on GitHub (Feb 5, 2015): Comment created by Gemorroj: Any comments plz..?
Author
Owner

@doctrinebot commented on GitHub (Feb 5, 2015):

Comment created by @ocramius:

[~Gemorroj] consider writing a test case with your problem/example: I can't understand the issue as it is currently written down.

A code example is also fine.

@doctrinebot commented on GitHub (Feb 5, 2015): Comment created by @ocramius: [~Gemorroj] consider writing a test case with your problem/example: I can't understand the issue as it is currently written down. A code example is also fine.
Author
Owner

@doctrinebot commented on GitHub (Feb 5, 2015):

Comment created by Gemorroj:

If you use the strategy SEQUENCE, the doctrine calls the sequence specified in the configuration. And inserts a record in the database with the specified ID.
If you are using the IDENTITY strategy, doctrine inserts a record without an ID. And after a record is inserted, causes sequence (8cbfefe03f/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php (L148)) to learn the value of id.
But, with the IDENTITY strategy, doctrine does not know how actually called a sequence.

!Захват-1.png!

@doctrinebot commented on GitHub (Feb 5, 2015): Comment created by Gemorroj: If you use the strategy SEQUENCE, the doctrine calls the sequence specified in the configuration. And inserts a record in the database with the specified ID. If you are using the IDENTITY strategy, doctrine inserts a record without an ID. And after a record is inserted, causes sequence (https://github.com/doctrine/dbal/blob/8cbfefe03ff2d1a2246dfb6e98b84e4b36622e6f/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php#L148) to learn the value of id. But, with the IDENTITY strategy, doctrine does not know how actually called a sequence. !Захват-1.png!
Author
Owner

@doctrinebot commented on GitHub (Feb 5, 2015):

Comment created by @ocramius:

Yes, when using the IDENTITY strategy, the sequence name is not used: 4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L626-L657)

That's expected behavior: what are you expecting?

@doctrinebot commented on GitHub (Feb 5, 2015): Comment created by @ocramius: Yes, when using the `IDENTITY` strategy, the sequence name is not used: https://github.com/doctrine/doctrine2/blob/4c68a38bd6b7d590dbfa90b2bb116129381935ce/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L626-L657 That's expected behavior: what are you expecting?
Author
Owner

@doctrinebot commented on GitHub (Feb 5, 2015):

Comment created by Gemorroj:

If doctrine determines that the database uses the sequence, then I expect the setup sequence doctrine is taken from the configuration.
4c68a38bd6/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (L636-L638)
The generated name sequence wrong for me.

@doctrinebot commented on GitHub (Feb 5, 2015): Comment created by Gemorroj: If doctrine determines that the database uses the sequence, then I expect the setup sequence doctrine is taken from the configuration. https://github.com/doctrine/doctrine2/blob/4c68a38bd6b7d590dbfa90b2bb116129381935ce/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php#L636-L638 The generated name sequence wrong for me.
Author
Owner

@doctrinebot commented on GitHub (Feb 5, 2015):

Comment created by @ocramius:

You should rather just use the SEQUENCE strategy.

Otherwise, provide a functional test case and eventually propose a fix.

@doctrinebot commented on GitHub (Feb 5, 2015): Comment created by @ocramius: You should rather just use the `SEQUENCE` strategy. Otherwise, provide a functional test case and eventually propose a fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4375