473,899 Members | 3,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table Locks and Preventing Deadlock

I`m exporting data from many Lotus Notes databases to a DB2 database
using LotusScript. The LotusScript agents commit after EACH
update/insert. Nevertheless, I keep getting transaction rollbacks on
deadlock or timeout. When I get a snapshot for locks, I see that one
of the export agents is getting a table lock rather than a row lock.
I`m guessing this is what causes the time out. Questions: how do I
determine whether it`s a deadlock or a timeout? If it`s because of the
table locks, what can I do to prevent it?
LOCKLIST = 64000
DLCHKTIME = 15000
MAXLOCKS = 20
LOCKTIMEOUT = 45
Thanks.
Randy
Nov 12 '05
11 14081
Ian <ia*****@mobile audio.com> wrote in message news:<40******* ***@corp.newsgr oups.com>...
Unfortunately you can't disable lock escalation entirely, without
resorting to locking the entire table for each transaction (this
would negatively affect concurrency :-)

If you have increased locklist (from 64000 to 128000) and maxlocks
(from 20 to 60), and are still having a problem, are you sure that
the changes have gone into effect? Keep in mind that the database
may need to be deactivated/reactivated for any changes to take effect
(I don't think you mentioned if you're on V7.x or V8.1).

Are you _sure_ your app is actually committing after each insert
or update? What is the scope of the update statements -- if each
update is updating a HUGE (with a 500 Mb locklist, and 60% available
per application you could lock well over 8,000,000 rows), maybe
something in your app is not right.

You should check the db2diag.log for more information. It will contain
information about lock escalations (like how many row locks were held
when escalation was triggered) as well as deadlocks. This may give you
a clue about an error in the app doing the migration. Trapping the SQL
will also help. As will running the app single threaded and monitoring
closely to see what's going on.

Good questions. Wish I was certain of the answers. I'm using
LotusScript LSC:LC classes and connectors. Of course since DB2 and
Lotus come from the same shop, you'd think they'd play well
together...
I am processing single rows. LotusScript agent code gets a Lotus Notes
document, and processes it to insert/update one row into one table.
The code, however, uses the LSX:LC fieldlist and connection classes so
I don't know what they are REALLY doing under the hood. I do have a
primary key and the agent explicitly identifies those two columns as
keys. As for actually commiting, again, I'm not issuing a direct SQL
statement. I use the connection class's "Action" method and specify
commit and assume it does so. I guess that I should be able to monitor
this someway in DB2 but I've only figured out (so far) how to get
snapshots and I've yet to catch anyting "in the act." Is there a way
to watch what's happening in real-time? I do have to say however, that
I took a look at snapshot for database and found 0 lock escalation
events. What I can't figure out is whether that info is cumulative or
if it's also instantaneous, i.e. 0 because I didn't catch one then or
cumulative and I really haven't had any. If the latter then I'm really
at a loss. Within any one agent, tables are populated serially so that
I don't get foreign key conflicts. Inserting one row at a time into my
contact table, shouldn't create deadlocks. However, I only get the
problem when I run multiple agents. I dont' see how this can create
deadlocks however, because each agent works wholly within its own
database and the primary key includes the Notes database replica ID.
So, no agent should be waiting for a commitment from another agent
because no agent is processing the same Notes database as any other
agent. I'm beginning to think that I just wrote bad code :-<
Thanks.
Randy
Nov 12 '05 #11
"EoRaptor" <rc*******@patm edia.net> wrote in message
news:fa******** *************** ***@posting.goo gle.com...
Ian <ia*****@mobile audio.com> wrote in message news:<40******* ***@corp.newsgr oups.com>...
Good questions. Wish I was certain of the answers. I'm using
LotusScript LSC:LC classes and connectors. Of course since DB2 and
Lotus come from the same shop, you'd think they'd play well
together...
Same shop? Same corporation, yes. Same development lab, no. Lotus remains
pretty much intact as a separate subsidiary located in the Boston area.
.. I am processing single rows. LotusScript agent code gets a Lotus Notes
document, and processes it to insert/update one row into one table.
The code, however, uses the LSX:LC fieldlist and connection classes so
I don't know what they are REALLY doing under the hood. I do have a
primary key and the agent explicitly identifies those two columns as
keys. As for actually commiting, again, I'm not issuing a direct SQL
statement. I use the connection class's "Action" method and specify
commit and assume it does so. I guess that I should be able to monitor
this someway in DB2 but I've only figured out (so far) how to get
snapshots and I've yet to catch anyting "in the act." Is there a way
to watch what's happening in real-time? I do have to say however, that
I took a look at snapshot for database and found 0 lock escalation
events. What I can't figure out is whether that info is cumulative or
if it's also instantaneous, i.e. 0 because I didn't catch one then or
cumulative and I really haven't had any. If the latter then I'm really
at a loss. Within any one agent, tables are populated serially so that
I don't get foreign key conflicts. Inserting one row at a time into my
contact table, shouldn't create deadlocks. However, I only get the
problem when I run multiple agents. I dont' see how this can create
deadlocks however, because each agent works wholly within its own
database and the primary key includes the Notes database replica ID.
So, no agent should be waiting for a commitment from another agent
because no agent is processing the same Notes database as any other
agent. I'm beginning to think that I just wrote bad code :-<
Thanks.
Randy


I am not certain what is happening, but if the LotusScript is explicitly
locking the entire table (SQL lock table statement) then a deadlock could
occur.

I would ask Lotus support about your problem.
Nov 12 '05 #12

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

Similar topics

1
1950
by: Vincento Harris | last post by:
Hi There is an application that runs on sql server. The application selects/updates some few tables frequently Once there is even a select on this table .It blocks other users sometimes for very long. Is there anything that can be done to reduce this? The table has 18000 rows and does not seem to have an index I thought indexing might help but 18000 rows without an index is no reason for 30 minutes of lock time. I will appreciate...
1
1825
by: cloverme | last post by:
The database is configured for single publisher, many subscribers, merge replication. The maintenance plan started to fail a couple of months ago and the database would not get backed up. After clearing all the locks, I am able to backup the database manually. The locks return again and I'm not able to backup the database with the maintenance plan. How can I get around the lock issue or solve it so that I can backup the database again?...
1
4006
by: dawatson833 | last post by:
I want to set an alert for a specific table whenever an event has caused a deadlock to occur on the table. I understand how to set up an alert. But I don't know which error number to use for the New Alert error number property for a deadlock. Or how to specify a deadlock on a specific table. Thanks, DW
3
3116
by: Uwe C. Schroeder | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi. I have the following little stored proc: CREATE OR REPLACE FUNCTION public.ib_nextval(varchar) RETURNS varchar AS 'DECLARE
8
2115
by: Noni Ledford | last post by:
Hi - I have a database on a network, and each user logins using a shortcut from his PC to the shared database. There is a table created by a make-table query that locks up whenever more than one user is in the database. It doesn't matter that the users open completely different clients, forms, etc, as long as there are more than one user opens the database this table locks up. And the function that recalculates the amount doesn't work. ...
1
2651
by: leon | last post by:
Hi all, I have an .mdb file (access database) which has been set to table level locking (i.e. not just records in question, but the whole table). The database is also in sharing mode (ie. not exclusive)... here is my problem: i have an application that accesses the aforementioned database from Jet ODBC driver and runs a query which implicitly locks the whole table -
2
7662
by: Jürgen Devlieghere | last post by:
Hi, We are creating event-driven multi-threaded applications on a daily basis. To help us solving deadlocks, we implemented a CriticalSection class that does dead-lock detection: an attempt to Enter() the critical section that would cause a deadlock logs the complete deadlock loop (thread / Critical section) and raises an exception. It has helped us a lot in the past. However, to prevent further deadlocks, and to get a higher...
0
1071
by: chenchutnv | last post by:
Hi, Please Give Some Examples For Table Locks And Releasing The Table. Let Me Know Clearly Abot The 'tablockx' Command.and How To Release The Table And Syntex For That......my Intention Is If One User Access The Table I Want To Restrict The Accessing From Other Users...give Me The Ex.... If Anybody Know. Thanking You, Venkat
1
1482
by: TimHop12 | last post by:
Hello, I ran into a problem, where I am not sure how sql server is reacting - There is a table dbo.T1 with columns (OWNER, DATA)- now I have 3 stored procs - dbo.Begin, dbo.Copy, dbo.END. There is a process running which reads a file (file contains - OWNER and DATA) and calls these procs in the sequence dbo.Begin, dbo.Copy, dbo.END. dbo.Begin proc deletes the data from dbo.T1 table where OWNER='X' dbo.Copy proc copies the data to...
0
11269
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10863
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10966
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10493
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9666
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8039
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7201
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3316
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.