Ask a Question related to Microsoft SQL / MS SQL Server, Design and Development.
-
basidati #1
Transaction
Within a procedure i create two connection
RConnection for readonly operation
WConnection for write operation on a DB.
Associated with the WConnection i create a Transaction with
isolationlevel ReadUncommitted;
All three object are stored in Session variables.
I use a class to perform operation on a DB and i need to have all
operation that could
modify the DB within the transaction
Here is the code :
string StrConn = "User ID="+UID+";Password="+PWD+";Initial
Catalog=Media;Data Source=(local)";
WConnection.ConnectionString = StrConn;
RConnection.ConnectionString = StrConn;
RConnection.Open();
WConnection.Open();
WTransaction =
WConnection.BeginTransaction(IsolationLevel.ReadUn committed);
Session["WConnection"] = WConnection;
Session["RConnection"] = RConnection;
Session["WTransaction"] = WTransaction;
In another procedure (within another asp.net page) i create an istance
of my object
and associate the connection
Document newDoc = new Document();
newDoc.Connection = WConnection;
newDoc.Transaction = WTransaction;
newDoc.Create(); // this insert a record in a table
in a second procedure i read the document list stored on the DB
Document Doc = new Document();
Doc.Connection = RConnection;
Doc.List();
Here is the code of the metod List()
SqlDataAdapter myCommand = new SqlDataAdapter("Document_List",
myConnection);
myCommand.SelectCommand.CommandType =
CommandType.StoredProcedure;
... // code for parameter of the storedprocedure
myCommand.ExecuteNonQuery();
At this point the program interrupts and this message is shown :
Timeout expired. The timeout period elapsed prior to completion of
the operation or the server is not responding.
If i was clear, can someone help me to understand what happens?
Does the transaction block the execution of the storedprocedure?
--
Posted via [url]http://dbforums.com[/url]
basidati Guest
-
WS-Transaction
I understand that 'WS-Transaction' is the standard for cross-webservice transaction management. Couple of questions :- 1) In what state of... -
Transaction Server 4.0
Dear all, Please let me know is Microsft Transaction Server 4.0 able to run on Windows 2003? Thanks -
Transaction id and transaction isolation
Hi Two questions. I am using Informix IDS 9.4 on Windows. 1. I would like to be able to get hold of the transaction id while still in the... -
transaction/session id in SE7.2
Hi I am using InformixSE7.2 (on linux) and have been trying to write a stored procedure which, amongst other things, gets hold of the session... -
Transaction Log
SQL 2K Is it possible to apply TRANSACTION LOG to a database while another process (SP) reading data from the same db.?? In my case, the job...



Reply With Quote

