Click here to Skip to main content
15,919,028 members
Home / Discussions / Database
   

Database

 
QuestionData Set object or XML file Pin
danaliasdan28-Dec-06 11:39
danaliasdan28-Dec-06 11:39 
QuestionList of Servers Pin
_mubashir27-Dec-06 7:41
_mubashir27-Dec-06 7:41 
AnswerRe: List of Servers Pin
Laubi28-Dec-06 0:57
Laubi28-Dec-06 0:57 
GeneralRe: List of Servers Pin
_mubashir28-Dec-06 4:27
_mubashir28-Dec-06 4:27 
GeneralRe: List of Servers Pin
Laubi28-Dec-06 4:34
Laubi28-Dec-06 4:34 
GeneralRe: List of Servers Pin
_mubashir28-Dec-06 5:37
_mubashir28-Dec-06 5:37 
AnswerRe: List of Servers Pin
Michael Potter28-Dec-06 9:33
Michael Potter28-Dec-06 9:33 
QuestionTransaction Query Pin
shaikshavali27-Dec-06 1:12
shaikshavali27-Dec-06 1:12 
Problem Description:

ADO .Net transaction fails for distributed databases and also even for a simple SQL Query that uses Dblink to Connect Oracle 8i.



When we fetch (query) data in SQL Server 2000 using dblink and connect to Oracle 8i and if this entire query is with-in ADO .Net transaction, then it fails. But the same query works fine without transaction.



Sample SQL query using DBLink in SQL Server.

Oracle Server Name for example: ORADB

Stored Procedure Name: UseDBLinkSP

SELECT * FROM [ORADB].SchemaName.TableName WHERE condition



Sample code in C#:

SqlConnection sqlCon = GetConnection ();

sqlCon.Open();

SqlTransaction trans = sqlCon.BeginTransaction();

try
{

DataAccessClass.getRecords(UseDBLinkSP, trans);

trans.Commit();

}

catch(Exception ex )

{

trans.Rollback();

throw ex;

}

finally

{

if (sqlCon != null && sqlCon.State != ConnectionState.Closed)

{

sqlCon.Close();

}

}

.

l Please note that we are only fetching information from the oracle database, but no updations or deletions.

l This is a sample code, in reality above and below dblink query we have couple of SQL Server Stored procedures that will insert/update/delete data in SQL Server also.



When we run the above code in C# or even in SQL Query Analyzer with Begin and CommitTrans it gives this error.



Error Message:

サーバー : メッセージ 7391、レベル 16、状態 1、行 2

OLE DB プロバイダ 'OraOLEDB.Oracle' は分散トランザクションを開始できなかったので、要求した操作は実行されませんでした。

[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator. ]

OLE DB エラー トレース [OLE/DB Provider 'OraOLEDB.Oracle' ITransactionJoin::JoinTransaction returned 0x8004d00a]



Environment:

1. .NET 1.1

2. ADO .NET 1.1

3. Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1) 0

4. Oracle 8i on Unix box.
AnswerRe: Transaction Query Pin
Colin Angus Mackay27-Dec-06 1:26
Colin Angus Mackay27-Dec-06 1:26 
GeneralRe: Transaction Query [modified] Pin
shaikshavali27-Dec-06 5:24
shaikshavali27-Dec-06 5:24 
QuestionLocking a table in sqlserver 2000 Pin
Uma Kameswari26-Dec-06 21:35
Uma Kameswari26-Dec-06 21:35 
AnswerRe: Locking a table in sqlserver 2000 Pin
Colin Angus Mackay27-Dec-06 0:20
Colin Angus Mackay27-Dec-06 0:20 
Questiontext color of a field Pin
248912826-Dec-06 20:13
248912826-Dec-06 20:13 
AnswerRe: text color of a field Pin
Paul Conrad27-Dec-06 18:26
professionalPaul Conrad27-Dec-06 18:26 
Questionupdate data from datagrid using ado in vb.net Pin
bhaskar varma26-Dec-06 19:45
bhaskar varma26-Dec-06 19:45 
AnswerRe: update data from datagrid using ado in vb.net Pin
Walter_H8-Jan-07 2:41
Walter_H8-Jan-07 2:41 
QuestionCopying text field Pin
Imtiaz Murtaza25-Dec-06 23:35
Imtiaz Murtaza25-Dec-06 23:35 
AnswerRe: Copying text field Pin
Mairaaj Khan27-Dec-06 1:02
professionalMairaaj Khan27-Dec-06 1:02 
QuestionExport and import commands using C# Pin
KishoreT25-Dec-06 21:16
KishoreT25-Dec-06 21:16 
QuestionMerging of two datasets Pin
KishoreT25-Dec-06 21:15
KishoreT25-Dec-06 21:15 
Questionmdb file in vs2005 support UTF8 Pin
hamidaman25-Dec-06 11:41
hamidaman25-Dec-06 11:41 
QuestionAssiging a Dataset to GridView Pin
rahul_spi25-Dec-06 8:18
rahul_spi25-Dec-06 8:18 
AnswerRe: Assiging a Dataset to GridView Pin
PavanPareta25-Dec-06 17:22
PavanPareta25-Dec-06 17:22 
QuestionHow to connect the POstgreSQL 8.1.4 with Borland Developer Studio 2006 (Delphi.NET) Pin
Dotnetfish25-Dec-06 5:29
Dotnetfish25-Dec-06 5:29 
AnswerRe: How to connect the POstgreSQL 8.1.4 with Borland Developer Studio 2006 (Delphi.NET) Pin
Keith Malwitz25-Dec-06 17:40
Keith Malwitz25-Dec-06 17:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.