473,698 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beginner question: a lock without exceptions?

I'm not experienced in db2, but I have to write some rather complex
processing with stored procedures for db2 on as400.

The database consists of some twenty tables and is prepared in advance
so it does not change, while I run my procedures. I call the
procedures over ODBC from a Microsoft Access and Microsoft Windows
client. The procedures also doesn't write anything into this database,
but all the output goes into "global temporary tables". At the end the
results are sent over ODBC to the client. There are also other users
working on the same database at the same time. I don't know how many
of them and what they do, but it is sure, that they don't change the
data in the tables as well.

Now the problem is, that I sometimes get different results from one
run to another although the database is not changend in the
meantime. The database is changed only over the night.

Is it possible, that someone locks some data and my procedures
silently skips such data without raising any expcetion? I didn't give
any special options in may SQL. I also didn't write any code to catch
the exceptions, so they would stop the program, if they occured.

The processing is rather lenghty, about half an hour, and the error
happens so rarely that I'm quite in a despair to catch it by trial and
error.

Maks Romih
Nov 23 '05 #1
2 1365
I would wonder if things actually are being changed. If they are, and
you require a consistant snapshot, ISOLATION LEVEL might be what you
need. The SQL Reference Volume 1 in "Chapter 1. Concepts" has a section
on "Isolation levels" and "Appendix H. Comparison of isolation levels"
has a chart comparing the different ones.

B.

Nov 23 '05 #2
Thank you for your consideration.

I've come a little closer to the problem, but it seems, still further
from the solution.
The problem is not in locking or other users. That's why I changed the
thread title.

The records get lost in a simple SQL that only copies one temporary
table into another.
The table is about million records, some hundred bytes each record.

I've noticed, that every time, when it happens, the system is somehow
very loaded.
One of the SQL-s in the process that usually finishes in a second, at
that time needs 15 minutes.

But it does finish, everything does finish. Without exception.
And finishes wrong.

Is it possible to give some option or some other way of running my
stored procedures in a more sensitive way, so I would get an exception
if the system is too loaded, or simply somehow raise the "level of
sensitivity". It's hardly credible that the records can be lost so
simply.

Maks Romih.

Nov 24 '05 #3

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

Similar topics

8
7586
by: Shamrokk | last post by:
My application has a loop that needs to run every 2 seconds or so. To acomplish this I used... "Thread.Sleep(2000);" When I run the program it runs fine. Once I press the button that starts the looping function the window becomes unmovable and cannot close under its own direction (the upper right "close 'X'") My first attempt to solve the problem was to have the looping function execute as its own thread, the idea being this would...
14
3831
by: Gary Nelson | last post by:
Anyone have any idea why this code does not work? FileOpen(1, "c:\JUNK\MYTEST.TXT", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Shared) Dim X As Integer For X = 1 To 26 FilePut(1, Chr(X + 64)) Next Lock(1, 5, 10)
4
1668
by: Yoram Biberman | last post by:
I have a few questions concerning concurrency control. I shall thank whoever can help me. Question #1 ========= Assume the following (concurrent) schedule, in which both transactions run in a serializable isolation level: T1 begin T2 begin T1 modifies an item A
33
2397
by: aaron | last post by:
I have a question in my class.. hoping to get some help I need to create a program that will print firstName middleName lastName then their initials User will input: John Smith Doe Output: John
0
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
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
7725
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
6518
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
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.