dbTalk Databases Forums  

A problem in Distributed Transaction in a procedure

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss A problem in Distributed Transaction in a procedure in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bishoy George
 
Posts: n/a

Default A problem in Distributed Transaction in a procedure - 06-24-2005 , 08:31 PM






-- I made the following local procedure:

create procedure proc_AccountTransfer
@client varchar(50) = null
,@account varchar(50) = null
,@amount money = null
as
set nocount on
set ansi_warnings on
set xact_abort on
begin distributed transaction

exec proc_AccountFrom 'Bishoy','Saving',1000

exec server01.Northwind.dbo.proc_AccountTo 'Bishoy','Saving',1000

commit transaction

go


-- I also made local procedure:

create procedure proc_AccountFrom
@client varchar(50) = null
,@account varchar(50) = null
,@amount money = null
as
set nocount on

update client03.Northwind.dbo.ClientAccount
set AccountAmount = AccountAmount - @amount
where ClientName = @client and AccountName = @account

go



-- I also made a procedure on the server:

create procedure proc_AccountTo
@client varchar(50) = null
,@account varchar(50) = null
,@amount money = null
as

set nocount on

update server01.Northwind.dbo.ClientAccount
set AccountAmount = AccountAmount + @amount
where ClientName = @client and AccountName = @account

set nocount off


-- The table code:
use northwind
go
CREATE TABLE [dbo].[ClientAccount]
(ClientID int IDENTITY (1,1) NOT NULL
,ClientName varchar (50) NOT NULL
,AccountName varchar (50) NOT NULL
,AccountAmount money NOT NULL
,constraint PK_ClientID primary key clustered (ClientID)
,constraint CK_Amount check (AccountAmount >= 0)
)
go
insert into dbo.ClientAccount values ('Bishoy','Checking',100000)
insert into dbo.ClientAccount values ('Bishoy','Saving',2000)
go


-- But I received the following response:
Server: Msg 7391, Level 16, State 1, Procedure proc_AccountTransfer, Line 12
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransacti on returned 0x8004d00a].

-- Although:
The DTS was active on both servers --- and they was linked
--- and the tables present

--
Thank you.
Bishoy





Reply With Quote
  #2  
Old   
Elecia
 
Posts: n/a

Default RE: A problem in Distributed Transaction in a procedure - 08-26-2005 , 06:15 AM






Good Morning,
I saw your post and I am having the exact same issue. I didn't see any
replys to your post but I was wondering if you ever resolved the issue and if
so could you share with me what it was.
Thanks,
--
Elecia


"Bishoy George" wrote:

Quote:
-- I made the following local procedure:

create procedure proc_AccountTransfer
@client varchar(50) = null
,@account varchar(50) = null
,@amount money = null
as
set nocount on
set ansi_warnings on
set xact_abort on
begin distributed transaction

exec proc_AccountFrom 'Bishoy','Saving',1000

exec server01.Northwind.dbo.proc_AccountTo 'Bishoy','Saving',1000

commit transaction

go


-- I also made local procedure:

create procedure proc_AccountFrom
@client varchar(50) = null
,@account varchar(50) = null
,@amount money = null
as
set nocount on

update client03.Northwind.dbo.ClientAccount
set AccountAmount = AccountAmount - @amount
where ClientName = @client and AccountName = @account

go



-- I also made a procedure on the server:

create procedure proc_AccountTo
@client varchar(50) = null
,@account varchar(50) = null
,@amount money = null
as

set nocount on

update server01.Northwind.dbo.ClientAccount
set AccountAmount = AccountAmount + @amount
where ClientName = @client and AccountName = @account

set nocount off


-- The table code:
use northwind
go
CREATE TABLE [dbo].[ClientAccount]
(ClientID int IDENTITY (1,1) NOT NULL
,ClientName varchar (50) NOT NULL
,AccountName varchar (50) NOT NULL
,AccountAmount money NOT NULL
,constraint PK_ClientID primary key clustered (ClientID)
,constraint CK_Amount check (AccountAmount >= 0)
)
go
insert into dbo.ClientAccount values ('Bishoy','Checking',100000)
insert into dbo.ClientAccount values ('Bishoy','Saving',2000)
go


-- But I received the following response:
Server: Msg 7391, Level 16, State 1, Procedure proc_AccountTransfer, Line 12
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransacti on returned 0x8004d00a].

-- Although:
The DTS was active on both servers --- and they was linked
--- and the tables present

--
Thank you.
Bishoy






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.