Skip to content

Oracle DBO Updates addressing persistModel and sequencing issues #123

wants to merge 3 commits into from

3 participants


These updates should address the ticket I made before #1666.

The _persist() method of Object is used to resolve the issue of sequence names not being available when persistModel is true in the controller. This was particularly a problem in the method lastInsertId(), which would only be passed a string of the table name, and would therefore have no other way of knowing the sequence name, which can be modified using a table prefix or through a model property. While caching is enabled, this update will resolve that issue, and when caching is disabled, so is persistModel, so this is no longer an issue.

Sequences now correctly take table prefixes.

A 'schema' key can be defined in the database configuration to allow faster enumeration of database tables by reducing the set to the relevant tables owner.

I've also changed the Oracle unit tests to be more inline with other DBOs, while including tests for these updates and some of the existing functionality.

Let me know if you think anything could be done better here.



benmurden added some commits Apr 5, 2011
@benmurden benmurden Added logic for use with defined schema in Oracle
A "schema" key can be used in the database config when you want to access a different schema without having to always use the dot syntax. This also improves efficiency when you only use tables from one schema.
@benmurden benmurden Added tablePrefix to described sequences
This avoids conflicts with separate sequences used in test suite fixtures, for example.
@benmurden benmurden Oracle DBO bugs fixed & added features + tests
This update addresses an issue with using persistModel and sequences in Oracle. The issue is described in ticket #1666

In the same ticket, the described sequence referencing bug has been addressed here.

A Schema switch has been added to the DB config. When the 'schema' key is defined, the DBO will use that to limit the table enumeration down to only those owned by the defined schema. This can greatly reduce table enumeration time, relative to the size of the database.

Added unit tests for these new features and reconfigured the Oracle test class to be consistent with other DBO unit tests. Some existing functionality will also now be tested.

I can break this down into several smaller commits if that would be easier. Probably a sensible thing to do, huh?

CakePHP member
lorenzo commented Oct 14, 2011

Yeah, it is a hard to read pull request. That is why no one has already looked at it..

CakePHP member

Thanks for the patch, but given the complexity and our inability to verify the fixes I'm going to err on the side of safety and not merge this.

@markstory markstory closed this Jul 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.