Jump to content

Sql Help


Recommended Posts

Posted

I have a proc which runs in a transaction for the time being lets say it takes 30 seconds to do the operation..if in the mean time i open a new instance and run select query this keeps running until the first instance gets completed(either commit/rollback) and then gives the result...how to allow the second instance to make it readable i get it write is not good but can we make this readable and avoid having to wait for 30 seconds? tried all the isolation levels

 

1st instance:

- Proc

 - Begin Tran

 

 --- 30 seconds of operations

--- using tableA

 

-- Commit/rollback

 

 

2nd instance:

 

select * from tableA(

Posted

Use select with no lock or something. But careful about the dirty reads

Posted

select with no lock vala use enti...1st instance lo transaction is going on which has updates i did try with no lock on 1st instance that is updates but no use

result is same

Use select with no lock or something. But careful about the dirty reads

 

Posted

select with no lock vala use enti...1st instance lo transaction is going on which has updates i did try with no lock on 1st instance that is updates but no use
result is same

Try it with select with no lock on second instance
Posted

i see your point but the second instance queries(through accessing UI) were written with no lock long longer longest back now it is not viable to change where this situation arises as there are too many...can we modify in instance 1 like making transaction isolation etc?

Try it with select with no lock on second instance

 

Posted

I have a proc which runs in a transaction for the time being lets say it takes 30 seconds to do the operation..if in the mean time i open a new instance and run select query this keeps running until the first instance gets completed(either commit/rollback) and then gives the result...how to allow the second instance to make it readable i get it write is not good but can we make this readable and avoid having to wait for 30 seconds? tried all the isolation levels

 

1st instance:

- Proc

 - Begin Tran

 

 --- 30 seconds of operations

--- using tableA

 

-- Commit/rollback

 

 

2nd instance:

 

select * from tableA(

ne requiremnt.. uncommitted data read cheyala.. or committed read cheyala?

Posted

i see your point but the second instance queries(through accessing UI) were written with no lock long longer longest back now it is not viable to change where this situation arises as there are too many...can we modify in instance 1 like making transaction isolation etc?



Let's think why we are using transactions in the first place ? ACid properties. Keep the system in a consistent state.

Transaction isolation levels use cheyyi. Again exercise caution about dirty reads lost updates repeatable reads phantom reads

Isolation levels lo read uncommitted read committed etc vuntayi. Google chesi use the one that suits yr req. Right now I m in an all day training or else I would have given u explanation in more details. Ltt for more details.
Posted

if its SQL server use nolock option in the select stmt of second session

Posted

select with no lock vala use enti...1st instance lo transaction is going on which has updates i did try with no lock on 1st instance that is updates but no use

result is same

 

with no lock use cheyalevu if u r updating data

 

but u can use nolock for 2nd transaction  as it is just  select

and select *  baduluga   try to filter with columns unless there are many in ur selection

like select ID, name .. from  

 

dbcc useroptions run chesi chudu for 1st transaction  u will see on which isolation that query is in. 

Posted

either way second instance lo read cheyali along with write...1st instance works records which 2nd instance doesnt touch

to make it clear looking for something like row lock instead of table

 

ne requiremnt.. uncommitted data read cheyala.. or committed read cheyala?

 

 

Posted

Let's think why we are using transactions in the first place ? ACid properties. Keep the system in a consistent state.

Transaction isolation levels use cheyyi. Again exercise caution about dirty reads lost updates repeatable reads phantom reads

Isolation levels lo read uncommitted read committed etc vuntayi. Google chesi use the one that suits yr req. Right now I m in an all day training or else I would have given u explanation in more details. Ltt for more details.

 

 

I have a proc which runs in a transaction for the time being lets say it takes 30 seconds to do the operation..if in the mean time i open a new instance and run select query this keeps running until the first instance gets completed(either commit/rollback) and then gives the result...how to allow the second instance to make it readable i get it write is not good but can we make this readable and avoid having to wait for 30 seconds? tried all the isolation levels

 

1st instance:

- Proc

 - Begin Tran

 

 --- 30 seconds of operations

--- using tableA

 

-- Commit/rollback

 

 

2nd instance:

 

select * from tableA(

Posted

I have a proc which runs in a transaction for the time being lets say it takes 30 seconds to do the operation..if in the mean time i open a new instance and run select query this keeps running until the first instance gets completed(either commit/rollback) and then gives the result...how to allow the second instance to make it readable i get it write is not good but can we make this readable and avoid having to wait for 30 seconds? tried all the isolation levels

 

1st instance:

- Proc

 - Begin Tran

 

 --- 30 seconds of operations

--- using tableA

 

-- Commit/rollback

 

 

2nd instance:

 

select * from tableA(

 

oracle/sql server? oracle ayithe kadu

btw, correct term is new session, not new instance man

 

Posted

i know man i used instance in general sense not sql server instance ...iyina vignana pradarsanalu vadhu vishayam chepu joke

oracle/sql server? oracle ayithe kadu

btw, correct term is new session, not new instance man

 

×
×
  • Create New...