Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. LINQ to SQL Performance & Resources

LINQ to SQL Performance & Resources

Scheduled Pinned Locked Moved LINQ
databasequestioncsharplinqbusiness
6 Posts 3 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eduard Keilholz
    wrote on last edited by
    #1

    Hey guys, I've been playing with LINQ to SQL and I'm pretty much surprised by the power of LINQ ;) However, I have this question... I'm developing a website having a business project handling all the communication with my (SQL) database. I created several business object which return data from SQL, or create/remove/modify them in the database. The database behind the website is not that large, it contains a few tables let's say 15 and the amount of data isn't scary too but... Does is matter if I create just one large DataContext for my entire database, or is it wise to create several DataContext object of tables related to each other or does that depend on the database size (amount of tables, or amount of data)?? I understand that when developing modules etc. you mey want each module to contain it's own DataContext, but in this case there's only one business object taking care of everything. Thanks for your opinions...

    .: I love it when a plan comes together :. http://www.zonderpunt.nl

    T P 2 Replies Last reply
    0
    • E Eduard Keilholz

      Hey guys, I've been playing with LINQ to SQL and I'm pretty much surprised by the power of LINQ ;) However, I have this question... I'm developing a website having a business project handling all the communication with my (SQL) database. I created several business object which return data from SQL, or create/remove/modify them in the database. The database behind the website is not that large, it contains a few tables let's say 15 and the amount of data isn't scary too but... Does is matter if I create just one large DataContext for my entire database, or is it wise to create several DataContext object of tables related to each other or does that depend on the database size (amount of tables, or amount of data)?? I understand that when developing modules etc. you mey want each module to contain it's own DataContext, but in this case there's only one business object taking care of everything. Thanks for your opinions...

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      T Offline
      T Offline
      Tarik Guney
      wrote on last edited by
      #2

      It doesnt matter how large your datacontext is :)

      I am not a perfect programmer,but i have perfect's programmers' habits.

      P 1 Reply Last reply
      0
      • T Tarik Guney

        It doesnt matter how large your datacontext is :)

        I am not a perfect programmer,but i have perfect's programmers' habits.

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        atarikg wrote:

        It doesnt matter how large your datacontext is

        Why? I've found that it DOES matter what's in your datacontext. There are a couple of gotchas to do with EntitySet/EntityRefs that you need to deal with if you have mixed datacontexts, and it's better to break the contexts down so that these issues are removed.

        Deja View - the feeling that you've seen this post before.

        My blog | My articles

        1 Reply Last reply
        0
        • E Eduard Keilholz

          Hey guys, I've been playing with LINQ to SQL and I'm pretty much surprised by the power of LINQ ;) However, I have this question... I'm developing a website having a business project handling all the communication with my (SQL) database. I created several business object which return data from SQL, or create/remove/modify them in the database. The database behind the website is not that large, it contains a few tables let's say 15 and the amount of data isn't scary too but... Does is matter if I create just one large DataContext for my entire database, or is it wise to create several DataContext object of tables related to each other or does that depend on the database size (amount of tables, or amount of data)?? I understand that when developing modules etc. you mey want each module to contain it's own DataContext, but in this case there's only one business object taking care of everything. Thanks for your opinions...

          .: I love it when a plan comes together :. http://www.zonderpunt.nl

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Eduard - I've found there to be a couple of issues with using a large DataContext to do with EntitySet/EntityRef items. You are better decomposing the application to use multiple contexts to avoid these issues. (See this[^] post for details.)

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          E 1 Reply Last reply
          0
          • P Pete OHanlon

            Eduard - I've found there to be a couple of issues with using a large DataContext to do with EntitySet/EntityRef items. You are better decomposing the application to use multiple contexts to avoid these issues. (See this[^] post for details.)

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            E Offline
            E Offline
            Eduard Keilholz
            wrote on last edited by
            #5

            Pete, The article seems to be just what I was looking for. I think you can say 'isolating' different 'parts' of your database in a separate DataContext is the way to go.. Thanks for your reply!

            .: I love it when a plan comes together :. http://www.zonderpunt.nl

            P 1 Reply Last reply
            0
            • E Eduard Keilholz

              Pete, The article seems to be just what I was looking for. I think you can say 'isolating' different 'parts' of your database in a separate DataContext is the way to go.. Thanks for your reply!

              .: I love it when a plan comes together :. http://www.zonderpunt.nl

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              Eduard Keilholz wrote:

              Thanks for your reply!

              No problem. I faced this issue myself a while ago and it caused me a lot of grief looking for the solution. I wouldn't want anyone else to go through the same problems.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups