Question about relations, identity etc.

3 posts, 0 answers
  1. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 13 Oct 2010 Link to this post


    I'm quite new to ORM and have the following challenge ahead of me:

    I have to work with a SQL Server 2005 database within a Sitefinity Project. (3.7)
    This database contains personal information, addresses etc.

    The database is generated by some sort of tool that builds the database and a Windows Forms application to maintain it. I have to be able to read and write from the database from my Sitefinity project.

    1. The database has no relations defined inside SQL Server. Can I have full advantage of ORM if there are no relation or do I have to manually create associations first? And... will all this LINQ stuff work when I do this?

    2. All the Identity columns get there identity from a seperate table. So for each entity I will have to manually get a unique number from the database and after that update this seperate table. So actually a manual identity seed mechanism. Will this work?

    3. The database will be on a seperate server. So my website will have a remote connection to this database server. Is there something I should do to make this work with ORM? Maybe caching and transactions?

    Just like to know if these issues will be a real problem in ORM.

  2. Petko_I
    Petko_I avatar
    184 posts

    Posted 18 Oct 2010 Link to this post

    Hi Daniel,

    Let’s discuss your questions one by one in the order you asked them

    OpenAccess can handle a case in which you have associations only in the conceptual model without having constraints in the database. You can use LINQ without problems with such a scenario. The only thing you need to do is define your associations with the visual designer. Even if you do not have primary keys defined on your tables, our validation framework will help you resolve the conflicts.

    I also do not think you will encounter issues with the identity mechanism you have specified. As far as I understand the identity seed is not defined on the entity table but on the common table where all the identities reside. There should not be any obstacle to get the generated id and set it to an entity in another table.

    Working on a separate server is fine – in most of the real-case scenarios the deployment of the database is on a dedicated server. A valid connection string is the only thing you need to get your application running. However, in order to improve performance you can benefit of the L2 caching mechanism we provide. In short, it helps you cache persistent objects in a common in-memory pool used by several threads. This way the database connections are opened more sparingly and working in-memory with cached objects is preferred.

    If you have any doubts or questions feel free to contact us and we will try to respond quickly and thoroughly.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Daniel Plomp
    Daniel Plomp avatar
    130 posts
    Member since:
    Feb 2004

    Posted 20 Oct 2010 Link to this post

    Thanks. I will take a look into it and give it a try!

Back to Top