Showing posts with label assembly. Show all posts
Showing posts with label assembly. Show all posts

Friday, March 30, 2012

Poorly written assembly and CLR

As the CLR is hosted in the SQL OS.

How will the SQL OS handle a situation wherein I have a badly written .net assembly which is chewing up lot of memory and other system resources of the server.

1. Won’t it directly affect the SQL OS and the overall performance of the server?

2. The bad assembly is also hosted in the same app domain as other assemblies;As all assemblies owned by same user are hosted in the same app domain; will this approach not affect other .net assemblies running in the same Appdomain?

Thanks!

1. Whether it will affect the overall performance of the server depends on whether or not the server has enough memory and resources to handle however much it is chewing up :) 2. Yes, other assemblies in the same AppDomain could be affected; but you can control this to some degree by splitting things up into different AppDomains by using different owners... But let's get down to the more important question: If this assembly is so badly written, and using so much memory, why are you hosting it in-process? Wouldn't this be a better candidate for the application tier? The situation you describe is really no different than a badly written or improperly implemented T-SQL stored procedure. If you have something eating up all of the RAM and processor time on your server, perhaps you need to take a hard look at it from an architectural point of view. -- Adam MachanicPro SQL Server 2005, available nowhttp://www..apress.com/book/bookDisplay.html?bID=457-- <Yedu@.discussions.microsoft..com> wrote in message news:79d20459-8f1e-435f-97d9-9c8423852d11@.discussions.microsoft.com... As the CLR is hosted in the SQL OS. How will the SQL OS handle a situation wherein I have a badly written .net assembly which is chewing up lot of memory and other system resources of the server. 1. Won't it directly affect the SQL OS and the overall performance of the server? 2. The bad assembly is also hosted in the same app domain as other assemblies;As all assemblies owned by same user are hosted in the same app domain; will this approach not affect other .net assemblies running in the same Appdomain?Thanks!|||Adam,
On point 1 is it true that SQL OS punishes threads/assemblies that are performing poorly? How does this happen? On what criteria does SQL OS decide this?

On Point 2 I agree with you.

Thanks|||

Most of the memory for CLR comes outside SQL Server buffer pool. If the system runs out of memory then your CLR routine would get an OOM exception and SQL Server would abort this thread and consequently the memory would be freed.

For CPU, yes SQL Server punishes the threads that do not yield the scheduler in a reasonable amount of time. It would force them to yield and put them at the end of the scheduler.

Thanks,
-Vineet.

Monday, March 12, 2012

Pls help. new to xml.

If an assembly Box consists of Parts listed how do I retrieve record set
that lists
Box and all its parts as
Assembly Part
-- --
Box 1-400-53
Box 1-1-45
Box 1-2-47
and so on.
Thank you so much for your help.
Farmer
DECLARE @.XmlDocumentHandle int
DECLARE @.XmlDocument nvarchar(1000)
SET @.XmlDocument = N'<ROOT>
<Assembly>
<Name>Box</Name>
<Part>1-400-53</Part>
<Part>1-1-45</Part>
<Part>1-2-47</Part>
<Part>1-802-57</Part>
<Part>1-300-48</Part>
<Part>1-851-55</Part>
<Part>1-850-54</Part>
<Part>1-800-52</Part>
<Part>1-801-50</Part>
<Part>1-700-56</Part>
<Part>1-1260-49</Part>
<Part>1-1260-44</Part>
<Part>1-1260-46</Part>
<Part>1-1260-58</Part>
<Part>1-1260-51</Part>
</Assembly>
</ROOT>'
-- Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @.XmlDocumentHandle OUTPUT, @.XmlDocument
-- Execute a SELECT stmt using OPENXML rowset provider.
SELECT *
FROM OPENXML(@.XmlDocumentHandle, N'/ROOT/Assembly', 2)
WITH (
AssName varchar(25) 'Name'
,Part varchar(25) 'Part'
)
EXEC sp_xml_removedocument @.XmlDocumentHandleHello Farmer,

> If an assembly Box consists of Parts listed how do I retrieve record
> set that lists
Um, you cheat... :)
SELECT *
FROM OPENXML(@.XmlDocumentHandle, N'/ROOT/Assembly/Part', 2)
WITH (
AssName varchar(25) '../Name',
Part varchar(25) '.'
)
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||I can't pass my judgement if it is "cheating" but it works. Thank you.
If understand it correctly, you extended path to read the dataset based on
Part as a tag instead of Assembly.
"Kent Tegels" <ktegels@.develop.com> wrote in message
news:b87ad74273e18c82ad3ef4dd330@.news.microsoft.com...
> Hello Farmer,
>
> Um, you cheat... :)
> SELECT *
> FROM OPENXML(@.XmlDocumentHandle, N'/ROOT/Assembly/Part', 2)
> WITH (
> AssName varchar(25) '../Name',
> Part varchar(25) '.'
> )
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>|||Hi,
Actually, you should use this method because you need to navigate to the
element that should be mapped to a row in the row pattern
Otherwise, openxml only recognize one subelement.
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
PLEASE NOTE: The partner managed newsgroups are provided to assist with
break/fix issues and simple how to questions.
We also love to hear your product feedback!
Let us know what you think by posting
from the web interface: Partner Feedback
from your newsreader: microsoft.private.directaccess.partnerfeedback.
We look forward to hearing from you!
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--
<b87ad74273e18c82ad3ef4dd330@.news.microsoft.com>
on|||Hi
How do I implement it the other way round; i.e. convert SQL Column into
a XML type?|||Hi,
Since our Newsgruop is an issue based support. Would you please open a new
post and describe your concern in detail. We are glad to be of assistance.
Best regards,
Vincent Xu
Microsoft Online Partner Support
========================================
==============
Get Secure! - www.microsoft.com/security
========================================
==============
When responding to posts, please "Reply to Group" via your newsreader so
that others
may learn and benefit from this issue.
========================================
==============
This posting is provided "AS IS" with no warranties,and confers no rights.
========================================
==============
--
19:49:23 GMT)
.NET CLR 1.1.4322; .NET CLR 2.0. 50727),gzip(gfe),gzip(gfe)[color=darkred
]
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTFEEDS01.phx.gbl!newsfeed00
.sul.t-online.de!t-online.de!border2.nntp.dca.giganews.com!border1.nntp.dca.
giganews.com!nntp.giganews.com!postnews.google.com!v46g2000cwv.googlegroups.
com!not-for-mail|||Look at the FOR XML functionality...
Best regards
Michael
<prabhupr@.hotmail.com> wrote in message
news:1144871356.496917.315650@.v46g2000cwv.googlegroups.com...
> Hi
> How do I implement it the other way round; i.e. convert SQL Column into
> a XML type?
>