Problems about locks
Posted in 2000
Topics: Transactions, Locking & Isolation
Hi! I've a lot of problems about the locks modes in Informix. I don't know how should I configure Informix(or my application, I'm not sure). My problem is that I launch a store procedure because I want to get a reports of data. If nobody attempt to update or insert in someone of my tables that I use in the foreach of my report, the result is good, but if someboy realize an operation(update, insert...) over someone of my tables, my reports return an error and only show the rows got until this moment. Can I do repair this?, what is the best solution about this? and what can I do?, I see the locks mode and isolation levels, but I don't know how can I apply it and I would like yours opinion and the best solution. Thank you for all. Pedro.
pmartinez@areanet.es (Pedro Martínez) writes: > Hi! > I've a lot of problems about the locks modes in Informix. > I don't know how should I configure Informix(or my application, I'm > not sure). My problem is that I launch a store procedure because I > want to get a reports of data. If nobody attempt to update or insert > in someone of my tables that I use in the foreach of my report, the > result is good, but if someboy realize an operation(update, insert...) > over someone of my tables, my reports return an error and only show > the rows got until this moment. > Can I do repair this?, what is the best solution about this? and what > can I do?, I see the locks mode and isolation levels, but I don't know > how can I apply it and I would like yours opinion and the best > solution. It sounds like you're missing a "SET LOCK MODE TO WAIT" statement in your procedure. Just add SET LOCK MODE TO WAIT or specify the time to wait (in seconds) like this: SET LOCK MODE TO WAIT 10 The manuals are pretty good btw;) Thomas
ok, I know this statement but It doesn't working. I was thinking about the dirty read, committed read...( I've been reading the help ;-) ), I don't know exactly how is working locks. The wait statement is useful when I launch an update and then the fetch for my reports. My problem arises when I launch my report and then the update, this situation cuts my reports. Thank you one more time. Pedro. On 30 Aug 2000 15:02:09 +0200, Thomas Parsli <thomas.parsli@startsiden.no> wrote: >pmartinez@areanet.es (Pedro Mart'nez) writes: > >> Hi! >> I've a lot of problems about the locks modes in Informix. >> I don't know how should I configure Informix(or my application, I'm >> not sure). My problem is that I launch a store procedure because I >> want to get a reports of data. If nobody attempt to update or insert >> in someone of my tables that I use in the foreach of my report, the >> result is good, but if someboy realize an operation(update, insert...) >> over someone of my tables, my reports return an error and only show >> the rows got until this moment. >> Can I do repair this?, what is the best solution about this? and what >> can I do?, I see the locks mode and isolation levels, but I don't know >> how can I apply it and I would like yours opinion and the best >> solution. > >It sounds like you're missing a "SET LOCK MODE TO WAIT" statement >in your procedure. > >Just add SET LOCK MODE TO WAIT or specify the time to wait (in seconds) >like this: SET LOCK MODE TO WAIT 10 > >The manuals are pretty good btw;) > >Thomas
In the report SET LOCK MODE TO WAIT 10; Thomas is right unless your updaters are keeping locks for long periods. In which case they need to be redesigned. Art S. Kagel "Pedro Martínez" wrote: > > ok, I know this statement but It doesn't working. I was thinking about > the dirty read, committed read...( I've been reading the help ;-) ), > I don't know exactly how is working locks. The wait statement is > useful when I launch an update and then the fetch for my reports. My > problem arises when I launch my report and then the update, this > situation cuts my reports. > Thank you one more time. > Pedro. > > On 30 Aug 2000 15:02:09 +0200, Thomas Parsli > <thomas.parsli@startsiden.no> wrote: > > >pmartinez@areanet.es (Pedro Martínez) writes: > > > >> Hi! > >> I've a lot of problems about the locks modes in Informix. > >> I don't know how should I configure Informix(or my application, I'm > >> not sure). My problem is that I launch a store procedure because I > >> want to get a reports of data. If nobody attempt to update or insert > >> in someone of my tables that I use in the foreach of my report, the > >> result is good, but if someboy realize an operation(update, insert...) > >> over someone of my tables, my reports return an error and only show > >> the rows got until this moment. > >> Can I do repair this?, what is the best solution about this? and what > >> can I do?, I see the locks mode and isolation levels, but I don't know > >> how can I apply it and I would like yours opinion and the best > >> solution. > > > >It sounds like you're missing a "SET LOCK MODE TO WAIT" statement > >in your procedure. > > > >Just add SET LOCK MODE TO WAIT or specify the time to wait (in seconds) > >like this: SET LOCK MODE TO WAIT 10 > > > >The manuals are pretty good btw;) > > > >Thomas
Your reporting Stored Proc (or its parent application) should have the statement "SET ISOLATION TO DIRTY READ". This tells Informix to ignore all locks for queries of that session. Caution : If your report is a multi-table report, you may have inconsistencies. Rudy "Pedro Martínez" wrote: > Hi! > I've a lot of problems about the locks modes in Informix. > I don't know how should I configure Informix(or my application, I'm > not sure). My problem is that I launch a store procedure because I > want to get a reports of data. If nobody attempt to update or insert > in someone of my tables that I use in the foreach of my report, the > result is good, but if someboy realize an operation(update, insert...) > over someone of my tables, my reports return an error and only show > the rows got until this moment. > Can I do repair this?, what is the best solution about this? and what > can I do?, I see the locks mode and isolation levels, but I don't know > how can I apply it and I would like yours opinion and the best > solution. > Thank you for all. > Pedro.
On Wed, 30 Aug 2000 12:44:20 GMT, pmartinez@areanet.es (Pedro Martínez) wrote:
>Hi!
>I've a lot of problems about the locks modes in Informix.
>I don't know how should I configure Informix(or my application, I'm
>not sure). My problem is that I launch a store procedure because I
>want to get a reports of data. If nobody attempt to update or insert
>in someone of my tables that I use in the foreach of my report, the
>result is good, but if someboy realize an operation(update, insert...)
>over someone of my tables, my reports return an error and only show
>the rows got until this moment.
>Can I do repair this?, what is the best solution about this? and what
>can I do?, I see the locks mode and isolation levels, but I don't know
>how can I apply it and I would like yours opinion and the best
>solution.
>Thank you for all.
>Pedro.
You can
SET ISOLATION TO DIRTY READ
if you want to see locked rows. But you will see phantom rows, too.
Nebojsa