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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Automation SP tocall an Object in clustered server

Author  Topic 

krishap
Starting Member

2 Posts

Posted - 2005-10-12 : 12:24:56
Hi
I 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 Server
pls suggest what should I check for. Here is the code.



DECLARE @object int
DECLARE @hr int
DECLARE @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 OUT
select 'After OACreate'
select @hr
select @object
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

-- Call a method that returns a value.
EXEC @hr = sp_OAMethod @object, 'LogChangesInCRSToAdapterSelectQueue', @methodreturnvalue OUT, 608898346
select 'After OAMethod'
print @methodreturnvalue
select @hr
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END
PRINT @return

-- Destroy the object.
EXEC @hr = sp_OADestroy @object
select 'After OADestroy'
select @hr
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

Thanks
RK

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>
Go to Top of Page

krishap
Starting Member

2 Posts

Posted - 2005-10-12 : 14:06:35
Hi Michael
Thank 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

Hi
I 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 Server
pls suggest what should I check for. Here is the code.



DECLARE @object int
DECLARE @hr int
DECLARE @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 OUT
select 'After OACreate'
select @hr
select @object
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

-- Call a method that returns a value.
EXEC @hr = sp_OAMethod @object, 'LogChangesInCRSToAdapterSelectQueue', @methodreturnvalue OUT, 608898346
select 'After OAMethod'
print @methodreturnvalue
select @hr
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END
PRINT @return

-- Destroy the object.
EXEC @hr = sp_OADestroy @object
select 'After OADestroy'
select @hr
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END

Thanks
RK



Go to Top of Page
   

- Advertisement -