Showing posts with label message. Show all posts
Showing posts with label message. Show all posts

Sunday, March 25, 2012

Cluster Log error message

Hello to all,
I'm investigating an application outage issue on a 2-node W2K Adv Server
cluster. A Generic Application is running on the cluster in a remote site,
and connects to a UNIX-based Oracle db at my site. There are intermittent
MRxSMB 3019 Event IDs which I'm not too worried about. I just used Q138365
to adjust the autodisconnect value to -1.
But I'm finding this error message in the Cluster log:
Network Name <Network Name CLUSTER VIRTUAL NAME>: Failed to register DNS PTR
record X.X.X.X.in-addr.arpa. for host CLUSTER VIRTUAL NAME FQDN, status 9005
I can't find anything documented about this error, so I can't tell if this
is something to be concerned about. Is it nothing, a cluster service
problem, DNS registraion problem?
Any thoughts would be greatly appreciated.
Thanks in advance.
Hey I had this error as well when I was setting up my cluster
To fix it:
o Right-click the network connection for your heartbeat adapter, and then
click Properties.
o Click Internet Protocol (TCP/IP), and then click Properties
o On the DNS tab, verify that no values are defined. Make sure that the
Register this connection's address in DNS is cleared.
Hope this helps!!
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:932C28D9-F8C2-4F83-BE57-AA149AF27065@.microsoft.com...
> Hello to all,
> I'm investigating an application outage issue on a 2-node W2K Adv Server
> cluster. A Generic Application is running on the cluster in a remote
site,
> and connects to a UNIX-based Oracle db at my site. There are intermittent
> MRxSMB 3019 Event IDs which I'm not too worried about. I just used
Q138365
> to adjust the autodisconnect value to -1.
> But I'm finding this error message in the Cluster log:
> Network Name <Network Name CLUSTER VIRTUAL NAME>: Failed to register DNS
PTR
> record X.X.X.X.in-addr.arpa. for host CLUSTER VIRTUAL NAME FQDN, status
9005
> I can't find anything documented about this error, so I can't tell if this
> is something to be concerned about. Is it nothing, a cluster service
> problem, DNS registraion problem?
> Any thoughts would be greatly appreciated.
> Thanks in advance.
sqlsql

Thursday, March 22, 2012

Cluster failing connections with SSL error message

We recently migrated our production environment from a win2k3/SQL 2000 EE cluster to a new 64 bit win2k3/ SQL 2005 SP1 Cluster.

Cluster works fine for a while (3-6 hours), then our logins start failing. We recieve the following error in the event log:

"The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications, depending on how the administrator has configured the server. See Books Online for information on this error message"

The only way to resume connectivity is to offline and online the sql service in the cluster.

The only reference to this error that I can find has something to do with a hotfix that might be available?

It's sad to say but we are experiencing the same issue.
Only we get this after a good 30 minutes...

Someone from Microsoft Spain is flying over here.

Very painful

|||

In working with microsoft PSS, we found the issue to be a permissions issue of all things.

Our service account did not have rights to lock pages in memory on either machines in the cluster. (even though is a domain administrator).

Once we gave it this right and restarted the SQL Server object in the cluster we have not had a similar failure since.

|||

This was unfortunately enabled already so it did not cause the problem here :-(

|||Hi Wesley,

Any joy with this? I'm currently going throught the same thing, and also have locked pages enabled for my SQL service account. I'm currently going through MS Support, but seem to be going around the houses :o(

Thanks

Stu|||Any luck, we have a similar problem.
We noticed that memory usage grows slowly beyond physical memory (32G) then connection failiurs start and server becomes inoperable.
Workaround solution is to reduce max mem in the server, down to 18G from (25).
This causes the server and OS to release memory. After the system stabilized we increased the maxmem in the server back to its original settng. Lock pages in memory is set.

Hope this helps.

This is a workaround, so we don't have to bounce the server, we are still looking for the cause.
esk.

Setup:2 node Cluster 4*dual 64bit AMD, 32Gb, SQL 2005 Enterprise SP0.|||

Hi,

Apparently we have hit a bug where the usercache size becomes too large and for every execution of a statement SQL Server has to check this store.
This store is not cleaned and keep growing too the point where lookups become blocked with spinlocks. If you want I can give you the commands to check this.

This will be fixed in SP2 because of the major impact a fix would have. The workaround is adding the users to the sysadmin group or clearing the cache manually with DBCC FREESYSTEMCACHE.

HTH

Kind regards,
Wesley

|||Thanks for the replies !

Wes, if you could give the command to check the spinlocks that would be great.

many thanks

Stu|||

Stu,

It's actually the query for checking the cache size.

SELECT * FROM sys.dm_os_memory_clerks
WHERE type = 'USERSTORE_TOKENPERM'
We have seen problems as of 150MB in our environment but this probably all depends on the load and types of queries. Add up the single pages and multipages to determine the size.

HTH
Wesley

|||Thanks Wesley!

After much investigation it turned out the problem was the iLO Management Channel Interface Driver (Cpqcidrv.sys) from Hewlett-Packard. Apparently this

is known to cause this issue on x64 editions of SQL Server 2005. The driver

causes the SQL Server 2005 64-bit working set to be trimmed!


We do not use ILO on our HP Servers, so I disable it in device manager, and so far so good (fingers crossed)!!!

Thanks

Stu|||

Great news!

There seems to be a hotfix for Windows 2003 concerning working set trims too.
Apparently working sets get trimmed when you use Terminal Services on the server... so beware ;-)

|||

If possible could you share the hotfix number? Thanks in advance,

Drew

|||

Hey Wesley. Can you please elaborate more on this 'working sets get trimmed' and beware. and the hotfix available? Thank you very much. I've had problems with this also.

|||

I am also have a problem with this issue. I am going to try disabling the ILO. The terminal service hotfix seems to be this one:

http://support.microsoft.com/kb/905865/en-us

sqlsql

Cluster failing connections with SSL error message

We recently migrated our production environment from a win2k3/SQL 2000 EE cluster to a new 64 bit win2k3/ SQL 2005 SP1 Cluster.

Cluster works fine for a while (3-6 hours), then our logins start failing. We recieve the following error in the event log:

"The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications, depending on how the administrator has configured the server. See Books Online for information on this error message"

The only way to resume connectivity is to offline and online the sql service in the cluster.

The only reference to this error that I can find has something to do with a hotfix that might be available?

It's sad to say but we are experiencing the same issue.
Only we get this after a good 30 minutes...

Someone from Microsoft Spain is flying over here.

Very painful

|||

In working with microsoft PSS, we found the issue to be a permissions issue of all things.

Our service account did not have rights to lock pages in memory on either machines in the cluster. (even though is a domain administrator).

Once we gave it this right and restarted the SQL Server object in the cluster we have not had a similar failure since.

|||

This was unfortunately enabled already so it did not cause the problem here :-(

|||Hi Wesley,

Any joy with this? I'm currently going throught the same thing, and also have locked pages enabled for my SQL service account. I'm currently going through MS Support, but seem to be going around the houses :o(

Thanks

Stu|||Any luck, we have a similar problem.
We noticed that memory usage grows slowly beyond physical memory (32G) then connection failiurs start and server becomes inoperable.
Workaround solution is to reduce max mem in the server, down to 18G from (25).
This causes the server and OS to release memory. After the system stabilized we increased the maxmem in the server back to its original settng. Lock pages in memory is set.

Hope this helps.

This is a workaround, so we don't have to bounce the server, we are still looking for the cause.
esk.

Setup:2 node Cluster 4*dual 64bit AMD, 32Gb, SQL 2005 Enterprise SP0.|||

Hi,

Apparently we have hit a bug where the usercache size becomes too large and for every execution of a statement SQL Server has to check this store.
This store is not cleaned and keep growing too the point where lookups become blocked with spinlocks. If you want I can give you the commands to check this.

This will be fixed in SP2 because of the major impact a fix would have. The workaround is adding the users to the sysadmin group or clearing the cache manually with DBCC FREESYSTEMCACHE.

HTH

Kind regards,
Wesley

|||Thanks for the replies !

Wes, if you could give the command to check the spinlocks that would be great.

many thanks

Stu|||

Stu,

It's actually the query for checking the cache size.

SELECT * FROM sys.dm_os_memory_clerks
WHERE type = 'USERSTORE_TOKENPERM'
We have seen problems as of 150MB in our environment but this probably all depends on the load and types of queries. Add up the single pages and multipages to determine the size.

HTH
Wesley

|||Thanks Wesley!

After much investigation it turned out the problem was the iLO Management Channel Interface Driver (Cpqcidrv.sys) from Hewlett-Packard. Apparently this

is known to cause this issue on x64 editions of SQL Server 2005. The driver

causes the SQL Server 2005 64-bit working set to be trimmed!


We do not use ILO on our HP Servers, so I disable it in device manager, and so far so good (fingers crossed)!!!

Thanks

Stu|||

Great news!

There seems to be a hotfix for Windows 2003 concerning working set trims too.
Apparently working sets get trimmed when you use Terminal Services on the server... so beware ;-)

|||

If possible could you share the hotfix number? Thanks in advance,

Drew

|||

Hey Wesley. Can you please elaborate more on this 'working sets get trimmed' and beware. and the hotfix available? Thank you very much. I've had problems with this also.

|||

I am also have a problem with this issue. I am going to try disabling the ILO. The terminal service hotfix seems to be this one:

http://support.microsoft.com/kb/905865/en-us

Cluster failing connections with SSL error message

We recently migrated our production environment from a win2k3/SQL 2000 EE cluster to a new 64 bit win2k3/ SQL 2005 SP1 Cluster.

Cluster works fine for a while (3-6 hours), then our logins start failing. We recieve the following error in the event log:

"The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications, depending on how the administrator has configured the server. See Books Online for information on this error message"

The only way to resume connectivity is to offline and online the sql service in the cluster.

The only reference to this error that I can find has something to do with a hotfix that might be available?

It's sad to say but we are experiencing the same issue.
Only we get this after a good 30 minutes...

Someone from Microsoft Spain is flying over here.

Very painful

|||

In working with microsoft PSS, we found the issue to be a permissions issue of all things.

Our service account did not have rights to lock pages in memory on either machines in the cluster. (even though is a domain administrator).

Once we gave it this right and restarted the SQL Server object in the cluster we have not had a similar failure since.

|||

This was unfortunately enabled already so it did not cause the problem here :-(

|||Hi Wesley,

Any joy with this? I'm currently going throught the same thing, and also have locked pages enabled for my SQL service account. I'm currently going through MS Support, but seem to be going around the houses :o(

Thanks

Stu|||Any luck, we have a similar problem.
We noticed that memory usage grows slowly beyond physical memory (32G) then connection failiurs start and server becomes inoperable.
Workaround solution is to reduce max mem in the server, down to 18G from (25).
This causes the server and OS to release memory. After the system stabilized we increased the maxmem in the server back to its original settng. Lock pages in memory is set.

Hope this helps.

This is a workaround, so we don't have to bounce the server, we are still looking for the cause.
esk.

Setup:2 node Cluster 4*dual 64bit AMD, 32Gb, SQL 2005 Enterprise SP0.|||

Hi,

Apparently we have hit a bug where the usercache size becomes too large and for every execution of a statement SQL Server has to check this store.
This store is not cleaned and keep growing too the point where lookups become blocked with spinlocks. If you want I can give you the commands to check this.

This will be fixed in SP2 because of the major impact a fix would have. The workaround is adding the users to the sysadmin group or clearing the cache manually with DBCC FREESYSTEMCACHE.

HTH

Kind regards,
Wesley

|||Thanks for the replies !

Wes, if you could give the command to check the spinlocks that would be great.

many thanks

Stu|||

Stu,

It's actually the query for checking the cache size.

SELECT * FROM sys.dm_os_memory_clerks
WHERE type = 'USERSTORE_TOKENPERM'
We have seen problems as of 150MB in our environment but this probably all depends on the load and types of queries. Add up the single pages and multipages to determine the size.

HTH
Wesley

|||Thanks Wesley!

After much investigation it turned out the problem was the iLO Management Channel Interface Driver (Cpqcidrv.sys) from Hewlett-Packard. Apparently this

is known to cause this issue on x64 editions of SQL Server 2005. The driver

causes the SQL Server 2005 64-bit working set to be trimmed!


We do not use ILO on our HP Servers, so I disable it in device manager, and so far so good (fingers crossed)!!!

Thanks

Stu|||

Great news!

There seems to be a hotfix for Windows 2003 concerning working set trims too.
Apparently working sets get trimmed when you use Terminal Services on the server... so beware ;-)

|||

If possible could you share the hotfix number? Thanks in advance,

Drew

|||

Hey Wesley. Can you please elaborate more on this 'working sets get trimmed' and beware. and the hotfix available? Thank you very much. I've had problems with this also.

|||

I am also have a problem with this issue. I am going to try disabling the ILO. The terminal service hotfix seems to be this one:

http://support.microsoft.com/kb/905865/en-us

Cluster failing connections with SSL error message

We recently migrated our production environment from a win2k3/SQL 2000 EE cluster to a new 64 bit win2k3/ SQL 2005 SP1 Cluster.

Cluster works fine for a while (3-6 hours), then our logins start failing. We recieve the following error in the event log:

"The server was unable to load the SSL provider library needed to log in; the connection has been closed. SSL is used to encrypt either the login sequence or all communications, depending on how the administrator has configured the server. See Books Online for information on this error message"

The only way to resume connectivity is to offline and online the sql service in the cluster.

The only reference to this error that I can find has something to do with a hotfix that might be available?

It's sad to say but we are experiencing the same issue.
Only we get this after a good 30 minutes...

Someone from Microsoft Spain is flying over here.

Very painful

|||

In working with microsoft PSS, we found the issue to be a permissions issue of all things.

Our service account did not have rights to lock pages in memory on either machines in the cluster. (even though is a domain administrator).

Once we gave it this right and restarted the SQL Server object in the cluster we have not had a similar failure since.

|||

This was unfortunately enabled already so it did not cause the problem here :-(

|||Hi Wesley,

Any joy with this? I'm currently going throught the same thing, and also have locked pages enabled for my SQL service account. I'm currently going through MS Support, but seem to be going around the houses :o(

Thanks

Stu|||Any luck, we have a similar problem.
We noticed that memory usage grows slowly beyond physical memory (32G) then connection failiurs start and server becomes inoperable.
Workaround solution is to reduce max mem in the server, down to 18G from (25).
This causes the server and OS to release memory. After the system stabilized we increased the maxmem in the server back to its original settng. Lock pages in memory is set.

Hope this helps.

This is a workaround, so we don't have to bounce the server, we are still looking for the cause.
esk.

Setup:2 node Cluster 4*dual 64bit AMD, 32Gb, SQL 2005 Enterprise SP0.|||

Hi,

Apparently we have hit a bug where the usercache size becomes too large and for every execution of a statement SQL Server has to check this store.
This store is not cleaned and keep growing too the point where lookups become blocked with spinlocks. If you want I can give you the commands to check this.

This will be fixed in SP2 because of the major impact a fix would have. The workaround is adding the users to the sysadmin group or clearing the cache manually with DBCC FREESYSTEMCACHE.

HTH

Kind regards,
Wesley

|||Thanks for the replies !

Wes, if you could give the command to check the spinlocks that would be great.

many thanks

Stu|||

Stu,

It's actually the query for checking the cache size.

SELECT * FROM sys.dm_os_memory_clerks
WHERE type = 'USERSTORE_TOKENPERM'
We have seen problems as of 150MB in our environment but this probably all depends on the load and types of queries. Add up the single pages and multipages to determine the size.

HTH
Wesley

|||Thanks Wesley!

After much investigation it turned out the problem was the iLO Management Channel Interface Driver (Cpqcidrv.sys) from Hewlett-Packard. Apparently this

is known to cause this issue on x64 editions of SQL Server 2005. The driver

causes the SQL Server 2005 64-bit working set to be trimmed!


We do not use ILO on our HP Servers, so I disable it in device manager, and so far so good (fingers crossed)!!!

Thanks

Stu|||

Great news!

There seems to be a hotfix for Windows 2003 concerning working set trims too.
Apparently working sets get trimmed when you use Terminal Services on the server... so beware ;-)

|||

If possible could you share the hotfix number? Thanks in advance,

Drew

|||

Hey Wesley. Can you please elaborate more on this 'working sets get trimmed' and beware. and the hotfix available? Thank you very much. I've had problems with this also.

|||

I am also have a problem with this issue. I am going to try disabling the ILO. The terminal service hotfix seems to be this one:

http://support.microsoft.com/kb/905865/en-us

Sunday, March 11, 2012

CLR Trigger -> Send Insert/Update/Delete Message to Windows Service

Hi,

I have an c# windows service, which is running on the same machine where my mssql server is installed. This service must be informed for each insert/update/delete event on one specific table.

My idea was to create an CLR Trigger for this table which can communicate with this service via .NET remoting. But the problem is, that the system.runtime.remoting assembly is not integrated within the mssql clr enviroment => i can't use remoting.

Are there any other idea's how can i solve this?

Best regards,
Thomas

Hi,

what about using Query Notification ?

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||I had the same problem as you and I have used two different tecniques: both of them uses CLR stored procs.

1. An OS event set by SqlServer: useful when to have to notify that an event occurred without any param. Each different event must be attached to a different event name.

[SqlProcedure]
public static void SetOsEvent(SqlString eventName) {
try {
EventWaitHandle.OpenExisting((string)eventName).Set();
}
catch (WaitHandleCannotBeOpenedException) {
}
}

2. An UDP Message. Useful for non-reliable and fast messaging system, such as broadcasting the internal net that an event has occurred.

[SqlProcedure]
public static void UdpSend(SqlString address, SqlInt32 port, SqlString message) {
try {
System.Net.Sockets.UdpClient client = new System.Net.Sockets.UdpClient();
byte[] datagram = message.GetUnicodeBytes();
client.Send(datagram, datagram.Length, (string)address, (int)port);
}
catch{
}
}

[SqlProcedure]
public static void UdpBroadcast(SqlInt32 port, SqlString message) {
try {
System.Net.Sockets.UdpClient client = new System.Net.Sockets.UdpClient();
byte[] datagram = message.GetUnicodeBytes();
System.Net.IPEndPoint ep = new System.Net.IPEndPoint(System.Net.IPAddress.Broadcast, (int)port);
client.Send(datagram, datagram.Length, ep);
}
catch {
}
}

Hope that helps.

CLR Stored Proc Queue activation help

I set up a queue to activate a clr stored procedure upon receiving a message and nothing is happening. I have tried everything listed in this topic:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=200684&SiteID=1

except for saying "Recieve Top(0)" which didn't make any sense to me. I have set the database to trustworthy (all of this is taking place within a single database on a local server). There are messages on the queue, and I have the queue activation set to max_queue_readers=2, procedure_name=StoredProcedure1, execute as owner. I tried execute as self and that didn't work either. I signed the assembly that contains StoredProcedure1 and the assembly that it references. The only thing that appears in the sql error log is this (I trimmed off the timestamp):

AppDomain 15 (TriggerTest.dbo[runtime].14) is marked for unload due to common language runtime (CLR) or security data definition language (DDL) operations.
AppDomain 15 (TriggerTest.dbo[runtime].14) unloaded.
AppDomain 18 (TriggerTest.dbo[runtime].17) created.

If I call the stored procedure manually it works just fine

I also tried signing the procedure (the t-sql stored proc that calls the clr proc) as described here:

http://blogs.msdn.com/remusrusanu/archive/2006/03/01/541882.aspx

Still no luck... The proc is never activated. The message sits in the queue until I manually retrieve it.

|||

If you issue an EXECUTE AS USER = 'nameofqueueowneruser'; followed by mannualy launching the procedure, do you get an error or is the procedure running fine?

Thanks,
~ Remus

|||The procedure runs fine when executed as you stated above.|||

Are you sure the queue activation is actually enabled? Activation can be set up (procedure name, max_queue_readers, execute as user) but the activation itself might be disabled. sys.service_queues.is_activation_enabled column will show this. If is disabled, then running ALTER QUEUE [queuename] WITH ACTIVATION (STATUS = ON) will enabled it. Note that the clause WITH ACTIVATION (STATUS = ON/OFF) is different from WITH STATUS = ON/OFF.

HTH,
~ Remus

|||Ok, apparently the procedure was running, it just wasn't retrieving the message from the queue. I changed the procedure to simply insert a row into a table and it did do that. Also, I set a breakpoint in the procedure, but VS2005 never stops. Now I need to figure out why it won't retrieve the message. Thanks for you help|||

How are you attempting to debug from Visual Studio?

For debugging, you need to attach to the sqlservr.exe process using remote debugger. We have tested that this works even for internally activated procedures.

Rushi

CLR Security Permissions on a sql 2005 server, service broker

A made a brokermethod just like in the helloworld_clr example in de service
broker example dir in sql 2005. The brokermethod receives a message and trie
s
to deserialize the message body which is a list of customer objects.
But when I try to deserialize I get the following exception.
It’s about something with permissions on an assembly. But I don’t have a
ny
experience with that.
Could someone tell me what I’m doing wrong?
Any help would be greatly appreciated.
CustomerMessage exception:
System.Security.SecurityException:
Request for the permission of type
'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(Pa
rseRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(Pars
eRecord pr)
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecor
d
pr)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWith
MapTyped(BinaryObjectWithMapTyped record)
at
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWith
MapTyped(BinaryHeaderEnum binaryHeaderEnum)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
erHandler
handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain,
IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream serializationStream)
at testservice.services.CustomerService.CustomerMessage(Message msgReceived,
SqlConnection connection, SqlTransaction transaction)
The action that failed was: Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was: MyComputerIs the broker method activated (WITH ACTIVATION (...) on the queue) or are
you invoking it from a user connection?
Activation has certain security restrictions because of the EXECUTE AS
context, see this blog
http://blogs.msdn.com/remusrusanu/a.../12/512085.aspx
Also, what kind of serialization are you using? Inside SQL Server there are
certain restrictions as the ordinary Xml serialization cannot be used, see
this blog http://blogs.msdn.com/sqlclr/archiv.../25/Vineet.aspx
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
"arn0" <arn0@.discussions.microsoft.com> wrote in message
news:E09E3890-12B6-491E-B990-1BECE84C5F62@.microsoft.com...
>A made a brokermethod just like in the helloworld_clr example in de service
> broker example dir in sql 2005. The brokermethod receives a message and
> tries
> to deserialize the message body which is a list of customer objects.
> But when I try to deserialize I get the following exception.
> It's about something with permissions on an assembly. But I don't have any
> experience with that.
> Could someone tell me what I'm doing wrong?
> Any help would be greatly appreciated.
> CustomerMessage exception:
> System.Security.SecurityException:
> Request for the permission of type
> 'System.Security.Permissions.SecurityPermission, mscorlib,
> Version=2.0.0.0,
> Culture=neutral,
> PublicKeyToken=b77a5c561934e089' failed.
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(
ParseRecord
> pr)
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(Pa
rseRecord
> pr)
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRec
ord
> pr)
> at
> System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWi
thMapTyped(BinaryObjectWithMapTyped
> record)
> at
> System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWi
thMapTyped(BinaryHeaderEnum
> binaryHeaderEnum)
> at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(He
aderHandler
> handler, __BinaryParser serParser, Boolean fCheck, Boolean
> isCrossAppDomain,
> IMethodCallMessage methodCallMessage)
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(Stream
> serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage)
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize
(Stream
> serializationStream)
> at testservice.services.CustomerService.CustomerMessage(Message
> msgReceived,
> SqlConnection connection, SqlTransaction transaction)
> The action that failed was: Demand
> The type of the first permission that failed was:
> System.Security.Permissions.SecurityPermission
> The Zone of the assembly that failed was: MyComputer|||Hello arn0,

> A made a brokermethod just like in the helloworld_clr example in de
> service broker example dir in sql 2005. The brokermethod receives a
> message and tries to deserialize the message body which is a list of
> customer objects.
> But when I try to deserialize I get the following exception.
> It’s about something with permissions on an assembly. But I don’t have
> any
> experience with that.
> Could someone tell me what I’m doing wrong?
> Any help would be greatly appreciated.
> CustomerMessage exception: System.Security.SecurityException: Request
> for the permission of type
> 'System.Security.Permissions.SecurityPermission, mscorlib,
> Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
> failed.
[SNIP]
> testservice.services.CustomerService.CustomerMessage(Message
> msgReceived, SqlConnection connection, SqlTransaction transaction)
> The action that failed was: Demand The type of the first permission
> that failed was: System.Security.Permissions.SecurityPermission The
> Zone of the assembly that failed was: MyComputer
Adding this to the .CLR and .ServiceBroker newsgroups as folks in those grou
ps
might be able to add more.
The example in question doesn't deserialize an object graph, at least from
what I can today. So unless you can post the code in question, we're probabl
y
not going to be help you much. I've done some work with simple serialization
of objects with SQLCLR and haven't run into this yet. Chances are this isn't
an object with the permissions of the assembly. You can change the permissio
n
level of an assembly when you catalog it by adding "with permission_set =
" and one of SAFE, EXTERNAL_ACCESS or UNSAFE. Try unsafe first here, but
I doubt its going to get your much as I'm guessing you're doing something
with CAS that SQLCLR doesn't like.
Oh BTW, are you trying to load the base objects from the GAC?
PS: send messages, not object graphics -- just had to get that out of my
system... :)
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||the customer object comes from a assambly I registered this assembly in the
db with this command
create ASSEMBLY CustomerAssembly
FROM 'd:\development\Customer.dll'
with PERMISSION_SET = unsafe
GO
this is the brokermethod code
<BrokerMethod("CustomerMessage")> _
Public Sub CustomerMessage(ByVal msgReceived As Message, ByVal
connection As SqlConnection, ByVal transaction As SqlTransaction)
writeToLog("CustomerMessage start", connection, transaction)
Try
Dim customerArray As List(Of Customer)
Dim bfmt As BinaryFormatter = New BinaryFormatter()
Dim cmd As SqlCommand
msgReceived.Body.Position = 0
customerArray = bfmt.Deserialize(msgReceived.Body)
cmd = connection.CreateCommand
cmd.Transaction = transaction
cmd.CommandText = "INSERT INTO [arnotest].[dbo].[customer]
([name],[lastname]) VALUES(@.name,@.lastname)"
Dim name As IDataParameter = cmd.Parameters.Add("@.name",
SqlDbType.NVarChar)
Dim lastname As IDataParameter = cmd.Parameters.Add("@.name",
SqlDbType.NVarChar)
For Each Item As Customer In customerArray
name.Value = Item.name
lastname.Value = Item.lastname
cmd.ExecuteNonQuery()
Next
Catch ex As Exception
writeToLog(String.Concat("CustomerMessage exception: ",
ex.ToString), connection, transaction)
End Try
End Sub|||Hello arn0,

> the customer object comes from a assambly I registered this assembly
> in the db with this command
> create ASSEMBLY CustomerAssembly
> FROM 'd:\development\Customer.dll'
> with PERMISSION_SET = unsafe
> GO
> this is the brokermethod code
> <BrokerMethod("CustomerMessage")> _
> Public Sub CustomerMessage(ByVal msgReceived As Message, ByVal
> connection As SqlConnection, ByVal transaction As SqlTransaction)
> writeToLog("CustomerMessage start", connection, transaction)
> Try
> Dim customerArray As List(Of Customer)
> Dim bfmt As BinaryFormatter = New BinaryFormatter()
> Dim cmd As SqlCommand
> msgReceived.Body.Position = 0
> customerArray = bfmt.Deserialize(msgReceived.Body)
> cmd = connection.CreateCommand
> cmd.Transaction = transaction
> cmd.CommandText = "INSERT INTO [arnotest].[dbo].[customer]
> ([name],[lastname]) VALUES(@.name,@.lastname)"
> Dim name As IDataParameter = cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> Dim lastname As IDataParameter =
> cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> For Each Item As Customer In customerArray
> name.Value = Item.name
> lastname.Value = Item.lastname
> cmd.ExecuteNonQuery()
> Next
> Catch ex As Exception
> writeToLog(String.Concat("CustomerMessage exception: ",
> ex.ToString), connection, transaction)
> End Try
> End Sub
Okay, so this is very similar (on the surface) to my lightweight example
except that I'm using XML rather than binary serialization. See: [0].
What does the Customer Class look like?
[0]: http://www.sqljunkies.com/WebLog/kt...serialized.aspx
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Hi arn0,
Sounds like you may be running into "SQL Server doesn't allow dynamic
serializer assemblies" behavior. If you're using "add web reference" you
need to pregenerate the serializer DLL (using sgen.exe) and catalog it
separately. The serializer needs to match the class its "serializing for"
WRT version.
Cheers,
Bob Beauchemin
http://www.SQLskills.com/blogs/bobb
"arn0" <arn0@.discussions.microsoft.com> wrote in message
news:D5AE8A90-EA04-4484-A5E2-EABD04584CFA@.microsoft.com...
> the customer object comes from a assambly I registered this assembly in
> the
> db with this command
> create ASSEMBLY CustomerAssembly
> FROM 'd:\development\Customer.dll'
> with PERMISSION_SET = unsafe
> GO
> this is the brokermethod code
> <BrokerMethod("CustomerMessage")> _
> Public Sub CustomerMessage(ByVal msgReceived As Message, ByVal
> connection As SqlConnection, ByVal transaction As SqlTransaction)
> writeToLog("CustomerMessage start", connection, transaction)
> Try
> Dim customerArray As List(Of Customer)
> Dim bfmt As BinaryFormatter = New BinaryFormatter()
> Dim cmd As SqlCommand
> msgReceived.Body.Position = 0
> customerArray = bfmt.Deserialize(msgReceived.Body)
> cmd = connection.CreateCommand
> cmd.Transaction = transaction
> cmd.CommandText = "INSERT INTO [arnotest].[dbo].[customer]
> ([name],[lastname]) VALUES(@.name,@.lastname)"
> Dim name As IDataParameter = cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> Dim lastname As IDataParameter = cmd.Parameters.Add("@.name",
> SqlDbType.NVarChar)
> For Each Item As Customer In customerArray
> name.Value = Item.name
> lastname.Value = Item.lastname
> cmd.ExecuteNonQuery()
> Next
> Catch ex As Exception
> writeToLog(String.Concat("CustomerMessage exception: ",
> ex.ToString), connection, transaction)
> End Try
> End Sub|||Hello Bob,

> Sounds like you may be running into "SQL Server doesn't allow dynamic
> serializer assemblies" behavior. If you're using "add web reference"
> you need to pregenerate the serializer DLL (using sgen.exe) and
> catalog it separately. The serializer needs to match the class its
> "serializing for" WRT version.
Nope, its not a Web Reference -- first thing I checked. As you can see from
the code provided, he using BinaryFormatter on the instance. But, is SGEN
only XML Serialization specific? If not, this is proably worth doing.
My current thought is that there's a CAS setting in the class (or something
that the class inherits) has a prohibited behavior.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/

Thursday, March 8, 2012

CLR Configuration option problem

Hai,
I develope one application using .Net framework 2.0 and sql server
2005.Some time the following message displayed
Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
configuration option
how to redtify the error
Regards
T.A.Krishna
Hi
"Krishna" wrote:

> Hai,
> I develope one application using .Net framework 2.0 and sql server
> 2005.Some time the following message displayed
> Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
> configuration option
>
This error normally refers to the 'CLR Integration' setting, which you can
set by using the Surface Area Configuration (SAC) tool. If you choose to set
the option by feature then under Database Engine you can see 'CLR
Integration' and the Enable CLR Integration checked box should be checked.

> how to redtify the error
> Regards
> T.A.Krishna
John
|||Krishna wrote:
> Hai,
> I develope one application using .Net framework 2.0 and sql server
> 2005.Some time the following message displayed
> Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
> configuration option
CLR integration is disabled by default.
You must change the configuration option:
EXEC sp_configure 'clr enabled', 1;
RECONFIGURE;
Best regards,
Marcin Guzowski
http://guzowski.info

Wednesday, March 7, 2012

CLR Configuration option problem

Hai,
I develope one application using .Net framework 2.0 and sql server
2005.Some time the following message displayed
Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
configuration option
how to redtify the error
Regards
T.A.KrishnaHi
"Krishna" wrote:
> Hai,
> I develope one application using .Net framework 2.0 and sql server
> 2005.Some time the following message displayed
> Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
> configuration option
>
This error normally refers to the 'CLR Integration' setting, which you can
set by using the Surface Area Configuration (SAC) tool. If you choose to set
the option by feature then under Database Engine you can see 'CLR
Integration' and the Enable CLR Integration checked box should be checked.
> how to redtify the error
> Regards
> T.A.Krishna
John|||Krishna wrote:
> Hai,
> I develope one application using .Net framework 2.0 and sql server
> 2005.Some time the following message displayed
> Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
> configuration option
CLR integration is disabled by default.
You must change the configuration option:
EXEC sp_configure 'clr enabled', 1;
RECONFIGURE;
Best regards,
Marcin Guzowski
http://guzowski.info

CLR Configuration option problem

Hai,
I develope one application using .Net framework 2.0 and sql server
2005.Some time the following message displayed
Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
configuration option
how to redtify the error
Regards
T.A.KrishnaHi
"Krishna" wrote:

> Hai,
> I develope one application using .Net framework 2.0 and sql server
> 2005.Some time the following message displayed
> Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
> configuration option
>
This error normally refers to the 'CLR Integration' setting, which you can
set by using the Surface Area Configuration (SAC) tool. If you choose to set
the option by feature then under Database Engine you can see 'CLR
Integration' and the Enable CLR Integration checked box should be checked.

> how to redtify the error
> Regards
> T.A.Krishna
John|||Krishna wrote:
> Hai,
> I develope one application using .Net framework 2.0 and sql server
> 2005.Some time the following message displayed
> Exceution of user code .Net framework is disabled .Enabled 'clr' emabled
> configuration option
CLR integration is disabled by default.
You must change the configuration option:
EXEC sp_configure 'clr enabled', 1;
RECONFIGURE;
Best regards,
Marcin Guzowski
http://guzowski.info

Closing a conversation later on and Microsoft Service Broker Interface (sample)

In a messaging application, a client sends a message to the server. The server uses Service Broker Interface, and is CLR based. On the server, the message has a life cycle - going throughout multiple transitions until is final (Pending, In Transit, Delivered, TimedOut, Undeliverable). As the server receives the message, it sends back to the client a reply status message of In Transit. It does so using the same message’s conversation. It also saves – along with the message – its conversation handle. The dialog is not closed. After a while, the server may decide that the message has gotten to a final state (Delivered or TimedOut). I would like at that time to send a reply status message (Final State) back to the client and also close the conversation. The conversation handle has been saved by both, client and server. Having the conversation handle available - how do I get back to the client later on?

Thanks,

I don't understand what you mean by 'get back to the client later on'. Do you want to send a message using the conversation handle which was saved earlier? That's simple, you only have to execute the SEND statement with the saved conversation handle (or call Conversation.Send(...) in the ServiceBrokerInterface sample). Note that you cannot send after the conversation has been closed at your endpoint.|||

Yes, indeed, I would like to send a message using the conversation handle thant was saved earlier. This will be done by a different thread. All I have saved is the conversation hanlde and I am thinking to create a Conversation object based on the handle only. Can it be done?

Thanks,

|||I'll have to look it up if the Conversation class has a public constructor. If not, the ServiceBrokerInterface library is free for you to modify :-)|||That's right :). I am thinking about this way: (new Service(server service parameters)).GetConversation (mySavedConversationHandle). Thanks for following up.

Sunday, February 12, 2012

ClickOnce Please Help

When having someone run my click once app that is using SQL CE they are getting this message.

The application requires that assembly System.Data.SqlServerCE Version 9.0.242.0 be installed in the global assembly cache (GAC) first

Can someone please let me know what I need to add to prerequisites?

Update on my issue. I have downloaded the development toolkit for CE and have set CE as a prerequisit. I ran click once and then published the application and downloaded it on a machine that does not have click once. The application installed and started. I went to do something that I know uses CE and I get this message Unable to load DLL sqlceme30.DLL.

|||Maybe you should have a look at this: http://msdn2.microsoft.com/en-us/library/bb219481.aspx

Clicking through to errors

When I click on an error message in the messages/results screen, it no longer highlights the correct section of code to show where the error is - somehow it has gone out of sync and just highlights a random piece of code.

Does anyone know how to reset it so that the error in the messages screen matches up to the correct line of code?

Thanks

Smile

Re-start SSMS, or reboot your computer...|||Hey there - thanks for getting back to me. I have tried both the restarting of the program and rebooting my PC - neither work. Sad

Clicking through to errors

When I click on an error message in the messages/results screen, it no longer highlights the correct section of code to show where the error is - somehow it has gone out of sync and just highlights a random piece of code.

Does anyone know how to reset it so that the error in the messages screen matches up to the correct line of code?

Thanks

Smile

Re-start SSMS, or reboot your computer...|||Hey there - thanks for getting back to me. I have tried both the restarting of the program and rebooting my PC - neither work. Sad