Hi.

Test project:

namespace ConsoleApplication1
{
    using ConsoleApplication11;

    using Xtensive.Orm;
    using Xtensive.Orm.Configuration;
    using Xtensive.Orm.Model;

    class Program
    {
        static void Main(string[] args)
        {
            var cfg = new DomainConfiguration("sqlserver", "Data Source=localhost; Initial Catalog=do40-tests; Integrated Security=True;")
            {
                UpgradeMode = DomainUpgradeMode.Recreate,
                ValidationMode = ValidationMode.OnDemand
            };

            cfg.Sessions.Add(new SessionConfiguration("Default")
            {
                BatchSize = 25,
                DefaultIsolationLevel = SessionConfiguration.DefaultDefaultIsolationLevel,
                CacheSize = 1000,
                Options = SessionOptions.Default | SessionOptions.AutoTransactionOpenMode | SessionOptions.AutoTransactionSuppressMode
            });

            cfg.Types.Register(typeof(Program).Assembly);

            var domain = Domain.Build(cfg);
        }
    }

    [HierarchyRoot]
    public class BaseEntity : Entity
    {
        [Field, Key]
        public int Id { get; private set; }
    }

    /// <summary>
    /// First entity
    /// </summary>
    [HierarchyRoot(InheritanceSchema = InheritanceSchema.SingleTable)]
    [Index("TestField", "TestLink", Unique = true, Name = "DescendantA.IX_TestFieldTestLink")]
    public class EntityA : Entity
    {
        [Field, Key]
        public int Id { get; private set; }

        /// <summary>
        /// TestField
        /// </summary>
        [Field]
        public string TestField { get; set; }

        /// <summary>
        /// TestLink
        /// </summary>
        [Field(Nullable = false)]
        public EntityB TestLink { get; set; }
    }

    /// <summary>
    /// Second entity
    /// </summary>
    [HierarchyRoot]
    public class EntityB : Entity
    {
        [Field, Key]
        public int Id { get; private set; }

        /// <summary>
        /// TestField
        /// </summary>
        [Field]
        public string TestField { get; set; }
    }

    /// <summary>
    /// Descendant
    /// </summary>
    [Index("Field", "TestField", Unique = true, Name = "DescendantA.IX_FieldTestField")]
    [Index("Field", Unique = true, Name = "DescendantA.IX_Field")]
    [Index("TestField", Unique = true, Name = "DescendantA.IX_TestField")]
    public class DescendantA : EntityA
    {
        [Field]
        public int Field { get; private set; }
    }
}

From three indexes on DescendantA in DB creates only second one. I think, it's logical with ClassTable scheme, but maybe should throw warning on update scheme step.

With ConcreateTable and SingleTable schemes, creates two indexes: second and third. First index ignored :(

asked Mar 05 '12 at 03:21

Anton%20Guschin's gravatar image

Anton Guschin
73303035

edited Mar 05 '12 at 03:22

Anton,

Thanks. We'll check this.

(Mar 05 '12 at 07:59) Dmitri Maximov Dmitri%20Maximov's gravatar image

Have you any news?

(May 04 '12 at 02:49) k_v_kuznetsov k_v_kuznetsov's gravatar image

ver2. Have you any news? This small bug is annoying (

(May 11 '12 at 03:15) k_v_kuznetsov k_v_kuznetsov's gravatar image

ver3. Have you any news?

(Jun 19 '12 at 10:45) k_v_kuznetsov k_v_kuznetsov's gravatar image

Konstantin, we are very sorry for the delay, we'are giving this annoying bug high priority and keep you informed about any progress.

(Jun 19 '12 at 14:46) Dmitri Maximov Dmitri%20Maximov's gravatar image

Have you any progress?

(Aug 01 '12 at 09:03) k_v_kuznetsov k_v_kuznetsov's gravatar image

We did the required investigation and found out that implementation of the feature you requested will take significant amount of time.

The reason: monstrous IndexBuilder must be almost rewritten, as there is a list of other issues concerning its improper functionality. Having that, we can only plan it for the next major release.

(Aug 03 '12 at 06:24) Dmitri Maximov Dmitri%20Maximov's gravatar image
1

Is it safe to create that index outside of DO.NET as a workaround?

(Aug 09 '12 at 04:29) Sebastian Hauer Sebastian%20Hauer's gravatar image

Hello Sebastian,

Yes, it is safe to create the index, however, it will be removed if DomainUpgradeMode.Recreate is used. In DomainUpgradeMode.Perform/PerformSafely it can be also removed if changes are made to tables that are used in the index.

(Aug 09 '12 at 05:27) Dmitri Maximov Dmitri%20Maximov's gravatar image

Do you have any progress on this issue? By the way, I have a suggestion: if the administrator creates an external index (which was definitely created manually and not through the DO), then leave it alone as long as it can be.

(Feb 11 '15 at 01:00) k_v_kuznetsov k_v_kuznetsov's gravatar image

One Answer:

We fixed the issue in DataObjects.Net 5.0.4 RC.

answered Feb 26 '15 at 05:12

Alexey%20Kulakov's gravatar image

Alexey Kulakov
77225

5.0.4 fixed

(Mar 31 '15 at 02:56) Anton Guschin Anton%20Guschin's gravatar image

5.0.6 With ConcreteTable still no warning

(Sep 15 '15 at 07:44) Anton Guschin Anton%20Guschin's gravatar image

Hi. What kind of warning do you mean?

(Sep 16 '15 at 02:32) Alexey Kulakov Alexey%20Kulakov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA