TransactionScope not working with EnlistTransaction
---------------------------------------------------
Key: DNET-439
URL: http://tracker.firebirdsql.org/browse/DNET-439
Project: .NET Data provider
Issue Type: Bug
Components: ADO.NET Provider
Environment: Server: Firebird V1.5.3.4870, Debian linux
Client: Provider 2.7.7, .NET 4.0
Reporter: Hélio Tibagí de Oliveira
Assignee: Jiri Cincura
Priority: Critical
Assuming the table "TEST" created in Firebird and SQLServer using the statement
below:
-------------------------------------------------------------------------------------------------------------------------
CREATE TABLE TEST (INTEGER_COLUMN INT NOT NULL)
Then, the following code in a console application connecting to the SQLServer:
-----------------------------------------------------------------------------------------------------------
SqlConnection connSQLServer = new SqlConnection("Data Source=localhost;Initial
Catalog=DATABASE;User ID=sa;Password=mypassword");
connSQLServer.Open();
using (TransactionScope scope = new TransactionScope())
{
connSQLServer.EnlistTransaction(Transaction.Current);
Int32 affectedLines = new SqlCommand("INSERT INTO TEST (INTEGER_COLUMN)
VALUES (1)", connSQLServer).ExecuteNonQuery();
Console.WriteLine(affectedLines); // ---> #1 line affected
}
Int32 persistedLines = (Int32)new SqlCommand("SELECT COUNT(*) FROM TEST",
connSQLServer).ExecuteScalar();
Console.WriteLine(persistedLines); // ---> #0 line persisted
Running the same code in Firebird:
------------------------------------------------
FbConnection connFirebird = new
FbConnection("User=SYSDBA;Password=masterkey;Database=myserver:backup02.fdb;Dialect=3;Charset=WIN1252;");
connFirebird.Open();
using (TransactionScope scope = new TransactionScope())
{
connFirebird.EnlistTransaction(Transaction.Current);
Int32 affectedLines = new FbCommand("INSERT INTO TEST (INTEGER_COLUMN)
VALUES (1)", connFirebird).ExecuteNonQuery();
Console.WriteLine(affectedLines);// ---> #1 line affected
}
Int32 persistedLines = (Int32)new FbCommand("SELECT COUNT(*) FROM TEST",
connFirebird).ExecuteScalar();
Console.WriteLine(persistedLines);// ---> #1 line persisted
The rollback is done successfully in SQLServer, but not in Firebird. Can you
fix this problem?
Thanks in advance.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider