D
daniel schmied
Hi,
i have some wired behaviour using c#, ado and sql server.
There are two tables on sql server: Order and Orderdetails.
(Order_ID is primary key on Table Order and foreign Key on
Orderdetails.)
I have two c# Classes calles Order and Orderdetails. They contain two
Methods for inserting Orders or Orderdetails on Database.
(Parameterized with an sql connection an an transaction.)
On the main programm a transaction is started an calling
Order.Insert(...)
Then, i do serveral Orderdetails.Insert(...) before committing the
transaction.
This works as supposed, but there is one big issue i cant figure out:
I start debugging the app and opend query-analyzer. After calling
Order.Insert(...)-but not yet committed the transaction - i am able to
do a "select * from order where order_id = 1".
BUT: After calling Orderdetail.Insert(...)in the code -but not yet
committing the transaction- i cant do a "select * from orderdetail
where order_id = 1), because Query Analyzer is waiting until the
transaction is commited.
Why that? I mean it did work for Order.Insert; why not for
Orderdetail.Insert???
When i use the command "select * from orderdetail with (readpast)
where order_id = 1" it asap returns data. (There are about 1000
Datarows in the Tables; that with order_id = 1 has been already
inserted. The isolationlevel is set to IsolationLevel.ReadUncommitted)
Can anyone help?
Thanks,
bye DS
i have some wired behaviour using c#, ado and sql server.
There are two tables on sql server: Order and Orderdetails.
(Order_ID is primary key on Table Order and foreign Key on
Orderdetails.)
I have two c# Classes calles Order and Orderdetails. They contain two
Methods for inserting Orders or Orderdetails on Database.
(Parameterized with an sql connection an an transaction.)
On the main programm a transaction is started an calling
Order.Insert(...)
Then, i do serveral Orderdetails.Insert(...) before committing the
transaction.
This works as supposed, but there is one big issue i cant figure out:
I start debugging the app and opend query-analyzer. After calling
Order.Insert(...)-but not yet committed the transaction - i am able to
do a "select * from order where order_id = 1".
BUT: After calling Orderdetail.Insert(...)in the code -but not yet
committing the transaction- i cant do a "select * from orderdetail
where order_id = 1), because Query Analyzer is waiting until the
transaction is commited.
Why that? I mean it did work for Order.Insert; why not for
Orderdetail.Insert???
When i use the command "select * from orderdetail with (readpast)
where order_id = 1" it asap returns data. (There are about 1000
Datarows in the Tables; that with order_id = 1 has been already
inserted. The isolationlevel is set to IsolationLevel.ReadUncommitted)
Can anyone help?
Thanks,
bye DS