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 Guys, I am trailing this software at the moment and let me say it looks really good!! There is just one major hurdle I have found and that is around sequences in oracle. Is it possible to define a sequence (that is not the light speed sequence) per table?? Thanks for you help guys, Josh |
|
|
Yes, but this requires a nightly build (it was added after we shipped 2.2). To get the nightly build, visit the downloads page (Express edition) or the store (retail editions). Please note the warning about uninstalling the RTM version before installing the nightly -- otherwise you will get designer errors after the upgrade. Once you have the nightly build, see http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=1988&PostID=5474 and http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=1988&PostID=6561 for information about how to set up the multiple-sequence strategy. You may also want to skim that thread for info about setting up the IdentityBlockSize and INCREMENT BY for your custom sequences. Let us know if you run into any problems -- we'll be happy to advise. |
|
|
Hi Ivan, I have done exactly as the threads suggest, however it is still trying to use the default sequence. I put a breakpoint on my multiSequence strategy class and to my surprise it was calling GetSequenceName not GetMultiSequenceName. Furthermore, I have noticed in the automatic generated code the following: [Table("BPS_CAMPAIGN_PERSON", IdColumnName="BPS_CAMPAIGN_PERSON_ID", Schema="CAMPAIGN", IdentityMethod=IdentityMethod.Sequence, CascadeDeletes=false)] Should it be: should it not be [Table("BPS_CAMPAIGN_PERSON", IdColumnName="BPS_CAMPAIGN_PERSON_ID", Schema="CAMPAIGN", IdentityMethod=IdentityMethod.MultiSequence, CascadeDeletes=false)] I'm using v2.2.1290.12172 of the DLL. Thanks for your help, Josh |
|
|
It looks like you are overriding the default identity method on that entity in the designer. As a general rule, you should not explicitly set Identity Method on a entity. This exists only to support the scenario where different tables need different identity methods, for example because some tables have GUID identities and others have integer identities. (A lot of people get misdirected by this option; it's clearly very confusing. We'll have to make it a lot harder to find in the next version of the designer I think!) So, first of all, in the designer change Identity Method to Default for all your tables. Then in your configuration file or the code where you initialise the LightSpeedContext, set the context's IdentityMethod to MultiSequence. Now all your entities will automatically inherit this identity method. Hope this helps -- if you still run into problems then please let us know! |
|
|
Hi Ivan, I'm still getting propblems, it seems to be working for one of my tables but not working for all of the others, it looks like it is trying to append the schema 2 times. CODE: public string GetMultiSequenceName(string defaultName, Type entityType) ERROR: Batch.BPS.BusinessObjects.Campaigns.IntegrationTests.ParticipantBonusAmountTester.INTEGRATIONTEST_CanWriteToTheDatabase: Thanks Again, Josh |
|
|
Could it be that TableAttribute.Name is including the schema? (What does attribute.Name show in the debugger?) If so, ensure that the schema is placed in the Schema setting and the Table Name contains only the actual table name. If this isn't the problem, have a look for differences in the schema / table attribute between the one that works and one of the ones that doesn't. If that still doesn't suggest an answer, could you provide us with a small project that demonstrates the problem please? You can attach a zip file via the Options tab. Thanks! |
|
|
Hi Ivan, I have got around the problem by explicitly defining the schema in the Sequence name, there seems to be a smell around the GetSchema method and multiple rows in the database being saved at once. public string GetMultiSequenceName(string defaultName, Type entityType) Hope this helps. |
|
|
Thanks for the info, Josh. I've logged a bug for this and we'll investigate further. |
|