Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
krishap
Starting Member
2 Posts |
Posted - 2005-10-12 : 12:24:56
|
| HiI have a problem with a client that I'm trying to fix for past 1 week and could not figure out what could be wrong.We provided a solution to the client where there is a windows service running and polling the database table and whenever there is changes in the table the poller takes the record and calls a method in the dll. This dll puts the data in a MSMQ.The client himself modified this process little bit by stoping the service and wrote a stored procedure ( its below) which call this dll and which in turn should put that in a queue.All is working well when this is on a stand alone machine, but when the client tests this on a clustered sql server it prints out all the messages in the sp and does not fail but doesnt put anything in the queue.The dll is registered in the Base machine of the Sql Serverpls suggest what should I check for. Here is the code.DECLARE @object intDECLARE @hr intDECLARE @property varchar(255)DECLARE @return varchar(255)DECLARE @src varchar(255), @desc varchar(255)declare @methodreturnvalue int-- Create an object.EXEC @hr = sp_OACreate 'DatabasePoller.DatabasePoller', @object OUTselect 'After OACreate'select @hrselect @objectIF @hr <> 0BEGINEXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUTSELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@descRETURNEND-- Call a method that returns a value.EXEC @hr = sp_OAMethod @object, 'LogChangesInCRSToAdapterSelectQueue', @methodreturnvalue OUT, 608898346select 'After OAMethod'print @methodreturnvalueselect @hrIF @hr <> 0BEGINEXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUTSELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@descRETURNENDPRINT @return-- Destroy the object.EXEC @hr = sp_OADestroy @objectselect 'After OADestroy'select @hrIF @hr <> 0BEGINEXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUTSELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@descRETURNENDThanksRK |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2005-10-12 : 12:49:40
|
| 1. Does the user that SQL Server is running as on the cluster have the correct permissions to do sp_OACreate etc?2. Is the DLL registered on BOTH nodes of the cluster?3. Have you made a test app to make sure that the DLL actually runs on the cluster nodes?Michael<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda> |
 |
|
|
krishap
Starting Member
2 Posts |
Posted - 2005-10-12 : 14:06:35
|
Hi MichaelThank for the quick reply, I'm trying to find out the answers for those questions you raised Do we have to register the dll in both the nodes? is it not OK to just register with the main server. quote: Originally posted by krishap HiI have a problem with a client that I'm trying to fix for past 1 week and could not figure out what could be wrong.We provided a solution to the client where there is a windows service running and polling the database table and whenever there is changes in the table the poller takes the record and calls a method in the dll. This dll puts the data in a MSMQ.The client himself modified this process little bit by stoping the service and wrote a stored procedure ( its below) which call this dll and which in turn should put that in a queue.All is working well when this is on a stand alone machine, but when the client tests this on a clustered sql server it prints out all the messages in the sp and does not fail but doesnt put anything in the queue.The dll is registered in the Base machine of the Sql Serverpls suggest what should I check for. Here is the code.DECLARE @object intDECLARE @hr intDECLARE @property varchar(255)DECLARE @return varchar(255)DECLARE @src varchar(255), @desc varchar(255)declare @methodreturnvalue int-- Create an object.EXEC @hr = sp_OACreate 'DatabasePoller.DatabasePoller', @object OUTselect 'After OACreate'select @hrselect @objectIF @hr <> 0BEGINEXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUTSELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@descRETURNEND-- Call a method that returns a value.EXEC @hr = sp_OAMethod @object, 'LogChangesInCRSToAdapterSelectQueue', @methodreturnvalue OUT, 608898346select 'After OAMethod'print @methodreturnvalueselect @hrIF @hr <> 0BEGINEXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUTSELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@descRETURNENDPRINT @return-- Destroy the object.EXEC @hr = sp_OADestroy @objectselect 'After OADestroy'select @hrIF @hr <> 0BEGINEXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUTSELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@descRETURNENDThanksRK
|
 |
|
|
|
|
|
|
|