SQLCLR Appdomains

  • Comments posted to this topic are about the item SQLCLR Appdomains

  • Had no idea, missed it but learnt something new. Good question Steve!!

  • I remember coming across this question earlier but even then got it wrong.

    M&M

  • Thanks for good question.

    I got my answer from url : http://msdn.microsoft.com/en-us/library/ms187720.aspx

    It says:

    There are several types of CLR integration managed database objects. For general information about these objects, see Building Database Objects with Common Language Runtime (CLR) Integration. Whenever these objects are executed, SQL Server creates an AppDomain under which it can load and execute the required code. The isolation level for an AppDomain is one AppDomain per database per owner.

  • There was a real similar question before, and I thought I'd remember the answer, but apparently I did not, as I took the wrong answer.

    But nice question though, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Got it right because I've on a few occasions seen messages in the error log saying "Appdomain <database name>.<something> has been unloaded due to memory pressure".

  • Good question, thanks. I got it right because I have a poster in my cube of SQL Server Dynamic Management Views and in the CLR section it clearly states: "SQL Server creates one AppDomain per database per owner so that all CLR objects are always executed in the same AppDoman." It's a good poster, lots of good stuff like this.

  • Great question! Guessed wrong, I thought it could be configured, but it actually makes sense.

    Peter Trast
    Microsoft Certified ...(insert many literal strings here)
    Microsoft Design Architect with Alexander Open Systems

  • I was confused by "all CLR objects owned by a user are always executed in the same AppDomain" which seems to contradict “one AppDomain per database per owner”.

  • Peter Trast (2/25/2011)


    Great question! Guessed wrong, I thought it could be configured, but it actually makes sense.

    Peter - It can be somewhat configured using the createdomain method.

    http://msdn.microsoft.com/en-us/library/yk22e11a(VS.90).aspx

    What the question is testing is that you can not configure two differant objects in two differant databases to run in the same app domain. SQL server will always load them into differant ones becuase it considers the database is the appdomain ROOT for any CLR objects loaded in them.

  • Thanks for the question, I learned something by it. (One of the thing was to check the date on blog posts, and if it is old you might want to look for a more current reference.)

  • Good question.

    I'm sure I've seen the same question before. If so, this is the second time I got it wrong.

    Tom

  • Daniel Bowlin (2/25/2011)


    Good question, thanks. I got it right because I have a poster in my cube of SQL Server Dynamic Management Views and in the CLR section it clearly states: "SQL Server creates one AppDomain per database per owner so that all CLR objects are always executed in the same AppDoman." It's a good poster, lots of good stuff like this.

    Daniel,

    Good you found out from the CLR object from the DMV poster, i have it in my cube but never looked at it. It is a good question!!!

  • Great question

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • SanDroid (2/25/2011)


    Peter Trast (2/25/2011)


    Great question! Guessed wrong, I thought it could be configured, but it actually makes sense.

    Peter - It can be somewhat configured using the createdomain method.

    http://msdn.microsoft.com/en-us/library/yk22e11a(VS.90).aspx

    What the question is testing is that you can not configure two differant objects in two differant databases to run in the same app domain. SQL server will always load them into differant ones becuase it considers the database is the appdomain ROOT for any CLR objects loaded in them.

    That is very good explanation and makes a lot of sense. Thanks

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic. Login to reply