This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Looking through your documentation I realized that LS does not support IdentityColumn for Oracle. Is there any work around at all for this? I am working with a legacy db with a table that takes care of it's own identity generation. Not sure why this is supported in SQL Server but not Oracle? What's the best way to work around this? I really need this to work, I've written my application and was ready to roll it out (I was testing in a 'keytable' enviornment) but just hit this wall! Please help! -SR |
|
|
I've tried to overide the identity generation using this: public partial class SampleItem : Entity<long>
{ Thinking that if I try to insert a null value into that column maybe it will allow the table to generate the Id but when I .Add the object to my unit of work I get an error: |
|
|
The reason we don't support this on Oracle is that we need to know the ID generated by the database, so we can reset the temporary ID in the identity map and fix up foreign key references for subsequent inserts. As far as we've been able to tell, Oracle doesn't provide a way to determine this. (SQL Server, by contrast, has the SCOPE_IDENTITY function, which is why we can support this on SQL Server.) There is no way to suppress the null value error. In any mode except IdentityColumn, LightSpeed expects to be assigning and inserting the ID value. The only way to get LightSpeed to suppress the ID column during INSERT is to use the IdentityColumn method, and that requires a SCOPE_IDENTITY-like function. If you're aware of a function that would do the job on Oracle, then let us know and we'd be very happy to add this support. We could possibly also offer some sort of option to configure the function so that you could issue the appropriate sequence- or table-specific calls depending on your database configuration. |
|