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, I’m trying to clear down all of the warnings in our current projects so we can spot real issues more easily in future. LightSpeed is currently outputting two types of warning so I was wondering if you could comment on whether they are actual problems and whether there is any way we can stop them being generated. 1) The field '<_discriminatorType>' is never used ( The warnings appear to relate to the discriminators in our model (other fields already have a #pragma disable around them). 2) Entity2 and Entity3 are part of the same inheritance hierarchy but have different discriminators ( These warnings accurately describe the situation with our discriminators, although I don’t really understand why the situation warrants a warning (the configuration has been running in production for 4 years now without us spotting any related problems). In case it’s relevant, the kind of approach we have with the inheritance on the relevant entities is:
Neither discriminator is explicitly represented in our model. Can any offer any advice? Thanks, Chris |
|
|
The forum seems to have inexplicably eaten some but not all of my angle bracket terms. It should still make sense but just to be clear, the ".cs" is referring to the main auto-generated model file and the ".lsmodel" is the main model definition file. Also: Can you offer any advice? :-) |
|
|
Is this a compiler warning (e.g. C# variable is not used as there is no property surfacing the value for the field)? If so does a
around the field declaration resolve the warning?
|
|
|
Yes, almost. This resolves the 1st warning:
Is there a way that this could be added to the generated model code? It looks like the 2nd warning is more directly related to LightSpeed ("Entity2 and Entity3 are part of the same inheritance hierarchy but have different discriminators"). Thanks, Chris |
|
|
Yep, that sounds reasonable to add that. Ill look at getting that tested and merged in tomorrow for the templates. In terms of the second warning, yep thats emitted by the designer to indicate you have an inheritance hierarchy where there are 2 different discriminators specified. Above you mention Entity3 inherits from Entity2 - does it specify the discriminator on the same field or two different fields?
|
|
|
Hi Jeremy, Thanks for that first improvement. It uses two different discriminator fields (or more - essentially one field per level of inheritance which I think goes 3 or 4 levels deep in a few classes). Thanks, Chris |
|
|
Ok - thanks for the clarification. That confirms why you are seeing the warning. We added this in because we saw a number of issues with CTI where multiple discriminators were specified in the hierarchy so we dont recommend that general configuration. If you are not seeing any issues you can ignore the message. Ill have a look if we can surface an option you can use to have it suppressed if you want to ignore it as I can understand how that would be a bit of a distraction :)
|
|
|
An option to disable the warning would certainly be helpful but since we're at a stage in development where we'll be cutting over onto an entirely new database server during deployment, we're open to making a few changes to the model and DB schema if that's a better option. Although it was a long time ago, I'm pretty sure that this multiple discriminator approach was the only way I could get the CTI to work when first building the model but I'm sure a lot has changed since LightSpeed 2. Do you a have record of the sorts of issues that led you to adding this warning? Obviously I want to take the "if it isn't broke, don't touch it" approach but it's not often we get an opportunity to make a schema change of this size so it would be useful to understand what problems might be waiting for us when we try to add the next feature to our application so we can make an informed decision. Thanks, Chris |
|
|
Hi Chris, The change relates to this forum thread: http://www.mindscapehq.com/forums/thread/3692 so Ivan added the warning in response to the errors seen there. "If it isn't broke, dont touch it" would be my approach also, the warning is fairly blunt in its application. Ive also committed the change for the templates today so this will be available in the next nightly build.
|
|
|
It looks like the warning may be only applicable if one is using class table inheritance. Our hierarchy uses single table inheritance so I suppose that's why we don't see any problems. I'm content that there shouldn't be any hidden problems lurking here for us but do you think it would be possible for the warning message to be skipped if the hierarchy uses STI? Thanks, Chris |
|
|
Yep, no problem in adjusting this. This will be updated in the next nightly build.
|
|