473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Views and Deadlocks

Can a View be used to avoid deadlocks?

I have a trigger that needs to select data from a row of a table that
may have been locked (possibly by the same execution thread that caused
the trigger to fire). I can't set the Isolation level of the Trigger
nor the SQL statement within the trigger(I believe that this is not
allowed).

Dec 7 '05 #1
5 1397
Karl wrote:
Can a View be used to avoid deadlocks?

I have a trigger that needs to select data from a row of a table that
may have been locked (possibly by the same execution thread that caused
the trigger to fire). I can't set the Isolation level of the Trigger
nor the SQL statement within the trigger(I believe that this is not
allowed).

Views are simply macros, so the short answer is no.
Howvere your reasoning is flawed. A session cannot lock withitself
unless you have started a new connection (unsupported) through a
backdoor external procedure.
If you really want to use a lower isolation level within teh trigger you
can experiment with a CALL statement in the trigger.
You can then either create the procedure with the appropriate bind
option or use the isolation clause on individual statements.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Dec 8 '05 #2
I'm using DB2 Version 7.2.
It was my understanding that a CALL Procedure statement from a trigger
was not allowed in version 7.2 - is this correct??

thankyou very much.

Dec 8 '05 #3
Karl wrote:
I'm using DB2 Version 7.2.
It was my understanding that a CALL Procedure statement from a trigger
was not allowed in version 7.2 - is this correct??


That's correct.

p.s: V7 is out of service for about 1 year now. Maybe you could consider
upgrading to V8?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Dec 8 '05 #4
Does a Connection encapsolate muliple Sessions? - If I were a single
user on a single computer and I executed muliple Update Statements
isn't it possible to get a deadlock?
- What if different tables while being updated tried to read from
eachother to modify the way that they updated?

Dec 9 '05 #5
Karl wrote:
Does a Connection encapsolate muliple Sessions? - If I were a single
user on a single computer and I executed muliple Update Statements
isn't it possible to get a deadlock?
- What if different tables while being updated tried to read from
eachother to modify the way that they updated?


A session is the same as a connection.

And yes, you can get a deadlock if you establish multiple, concurrent
connections. For locking purposes, it does not matter which user
established a connection. But you can never run into any locking problems
within the same connection. That's just an integral property of locks in
relational database systems.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Dec 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AKS | last post by:
I am getting lot of deadlocks in my application. As it is very complex ti avoid deadlocks at this stage of application we have done few steps to lessen the impact. We have added retries after...
3
by: Hasan | last post by:
Hi I'm having a problem with deadlocks in a table in SQL server when trying to update it through Biztalk 2004. There is no problem when I use the same Biztalk solution to update a similar dummy...
1
by: Matt White | last post by:
We've found deadlocks in the trace file that were not captured by our Powerbuilder application. Some deadlocks are trapped or, at least, reported to the user as a db error, and others are...
4
by: T Dubya | last post by:
We're experiencing a large number of deadlocks since we began running SQL Server 2000 Enterprise Edition SP3 on a Dell 6650 with hyper threading intel processors. We don't have the same problem on...
7
by: Marcus | last post by:
Hello all, I am trying to figure out when it is appropriate to use shared and exclusive locks with InnoDB. Using shared locks (lock in share mode), I can easily create a scenario with 2 clients...
9
by: Mike Carr | last post by:
I am running into an issue. Recently I installed IBuySpy Portal and then converted the data source to odp.net. When debugging the app my machine would freeze or become really slow. I can reproduce...
6
by: Greg Stark | last post by:
There's another poster complaining about referential integrity checks causing deadlocks. Unfortunately I've deleted the message so this response (and the archives aren't responding) isn't going to...
5
by: Daniel Wetzler | last post by:
Hi Sqlserver experts, I use the SQL Server enterprise manager of MSSQL 2000 regularly. I'm often annoyed by the automatic blanking of the table views. If this happens then mostly with the hint...
4
by: John Rivers | last post by:
There are many references to deadlock handlers that retry the transaction automatically. But IMO a deadlock is the result of a design flaw that should be fixed. My applications treat...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.