473,480 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

updating a lob

Hi folks
First time posting -if this is not the correct forum, please let me
know.

For updating a LOB in Oracle (using JDBC), you need to lock the row. Is
it true in DB2? How Are LOBs implemented in DB2 - Do you have a locator
and contents separated?

Thanx.

Nov 12 '05 #1
7 1842
"Menon" <rm*******@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hi folks
First time posting -if this is not the correct forum, please let me
know.

For updating a LOB in Oracle (using JDBC), you need to lock the row. Is
it true in DB2? How Are LOBs implemented in DB2 - Do you have a locator
and contents separated?

Thanx.

DB2 does not have explicit locking by the application program. DB2 will
automatically lock the row(s) depending on the SQL statement(s) and the
isolation level (for select statements). The one exception to this is the
lock table SQL statement.

The default is to lock by row, but this can be changed to always lock at the
table level when defining (or altering) the table definition.

Lock escalation can automatically occur from row locks to table locks by DB2
depending on a number of other factors, such as whether the locklist memory
is filled up. The size of the locklist for a database can be changed by the
DBA.

The actual data for a lob is stored separately from the rest of the table.
Nov 12 '05 #2
Thanx.
So this is because db2 does not support "read consistency" as supported
by Oracle, correct?

Thus in the case of db2, if you do a select on a lob and you start
updating
I guess at that point db2 would lock the row so that others can not
update it?
Sorry if the questions are basic - am not familiar with the db2 ...

Nov 12 '05 #3
"Menon" <rm*******@gmail.com> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
Thanx.
So this is because db2 does not support "read consistency" as supported
by Oracle, correct?

Thus in the case of db2, if you do a select on a lob and you start
updating
I guess at that point db2 would lock the row so that others can not
update it?
Sorry if the questions are basic - am not familiar with the db2 ...

The isolation level determines how long read locks are held. DB2 has the
following Isolation levels:

RR - Repeatable Read - Holds the share lock on all rows accessed. Releases
locks at next SQL commit.
RS- Read Stability - Hold share lock on all rows accessed. Releases locks
when SQL select statement finishes.
CS - Cursor Stability - Holds share lock on all rows accessed. Releases
locks when finished accessing a particular row (when DB2 read the next
row)..
UR - Uncommitted Read - No locks held (dirty read).

No other SQL statement can update a row while a share lock is being held,
but other share locks can coexist.

There is no lock contention for SQL statements in the same unit of work
(same application program). A share lock does not block an update by the
same program (only blocks others).

Isolation levels can be specified in numerous different ways, including in
each individual SQL statement. The default is CS.
Nov 12 '05 #4
Interesting...
Thanx for the info...
So when you say "There is no lock contention for SQL statements in the
same unit of work (same application program)." - you mean that in the
same "session"
there is no lock contention. But if you have selected a bunch of rows
in one session and you try to update them from another session
then except in the case of UR , the second session will block, correct?

Also curious to know if developers in DB2 world use the UR isolation
level due
to obvious reasons of data integrity compromise and what not. Any
applications
where this is recommended? I suspect that it may be useful where you
dont
care about exact computation and need to compute fast but approximate
results (e.g. in cases such as weather forecast etc where results need
not
be exact - this is just a random example but hopefully you get the
idea:))

Many thanx,

Nov 12 '05 #5
"Menon" <rm*******@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Interesting...
Thanx for the info...
So when you say "There is no lock contention for SQL statements in the
same unit of work (same application program)." - you mean that in the
same "session"
there is no lock contention. But if you have selected a bunch of rows
in one session and you try to update them from another session
then except in the case of UR , the second session will block, correct?

Also curious to know if developers in DB2 world use the UR isolation
level due
to obvious reasons of data integrity compromise and what not. Any
applications
where this is recommended? I suspect that it may be useful where you
dont
care about exact computation and need to compute fast but approximate
results (e.g. in cases such as weather forecast etc where results need
not
be exact - this is just a random example but hopefully you get the
idea:))

Many thanx,

Same application means the same program running in the same thread. The same
code running as another thread is another application.

UR was not in the original implementation of DB2 because IBM was somewhat
reluctant to allow any access to data that would not have data integrity. I
have used it in some situations where data integrity problems would not be
an issue and concurrency was a high priority.
Nov 12 '05 #6
Care to share an example where UR was used?
Thanx for all the help so far - appreciate it..

Nov 12 '05 #7
Menon wrote:
Care to share an example where UR was used?
Thanx for all the help so far - appreciate it..


I used it a couple times when I loaded/imported a huge amount of data into a
table, and I wanted to see the progress made so far.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #8

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

Similar topics

11
16059
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
2
4890
by: Hal Vaughan | last post by:
First, I am aware of both SwingUtilities.invokeLater(), and of using Thread to create a new thread.  These are part of the problem. I want to have something running in the background, while the...
45
2625
by: It's me | last post by:
I am new to the Python language. How do I do something like this: I know that a = 3 y = "a" print eval(y)
6
5752
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
0
1283
by: cwbp17 | last post by:
Have two tables that have a FK relationship on ID column. Have one datagrid that displays all of the columns of both tables. What's the best approach on updating a row from the datagrid back to...
10
5620
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
14
2910
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
6
4059
by: muttu2244 | last post by:
hi all am updating the same file in ftp, through multiple clients, but am scared that two clients may open the same file at a time, and try updating, then the data updated by one data will be...
0
1102
by: =?Utf-8?B?YmFrZXJzaGFjaw==?= | last post by:
Unless my app is EXTREMELY simple, I get the cross-threading error message regularly when updating controls on a Windows form. My latest example involves a dll that runs a System.Threading.Timer,...
5
5328
by: rosaryshop | last post by:
I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php. As the user makes selections, it updates images of various parts, giving them a preview of the...
0
6904
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
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
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...
0
6886
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.