"Zabach, Elke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> news [mailto:[EMAIL PROTECTED] Behalf Of Andrzej wrote:
> >
> > Hi
> >
> > I use C++ Builder 4.0 with SAPDB by ODBC (ver 7.4.3.30).
> >
> > I have serious problem during transaction. Sometimes when I try to
> > update one record in a table using TQuery component it last
> > too much time
> > (several minutes). It finish successfully but I think that it
> > is too long
> > time for updating one record.
> > As the resault my application does not responding several minutes.
> >
> >
> > I will be grateful for all opinions and advices because it is very
> > important for me to find reasons of this abnormal behaviour. I have to
> > resolve this problem to continue developing my application.
> >
> > More details:
> >
> > I use only two TQuery components (for expamle TQuery1 and TQuery2).
> >
> > 1. I start transaction.
> > 2. I execute several UPDATE and SELECT instructions in this
> > transaction
> > using both TQuery objects.
> > 3. I SELECT one record from the Table1 using TQuery1.
> > 4. I try to UPDATE one record in the Table2 using TQuery2.
> > (it last several
> > minutes)
> > 5. I commit transaction
> >
> > Table1 is a different table then Table2
> >
> > But if we delete step 3. everythimg is ok.
> >
> > 1. I start transaction.
> > 2. I execute several UPDATE and SELECT instructions in this
> > transaction
> > using both TQuery objects.
> > 3. I try to UPDATE one record in the Table2 using TQuery2.
> > (it executes very
> > quickly. OK)
> > 4. I commit transaction
> >
> >
>
> I think you do NOT have a single-user-db. Therefore we have to assume that
> other user(s) are working with the same tables.
> Depending on the isolation level the other user(s) use and the dml (select
> or insert/update/delete) they use, some records or the whole table are/is
locked.
> If you will update a record you need a NOT-locked record.
>
> If it is locked, you will wait for the commit/rollback of the other user.
If he has
> a long-lasting transaction that may need several minutes.
>
> Please check (when your task is waiting for the update) the systemtable
LOCKS
> and who/which task holds the row your task wants to lock.
>
> Elke
> SAP Labs Berlin
> > --
> > Andrzej Kazmierkiewicz
> > Remedium
> >
> >
> >
> >
> > --
> > MaxDB Discussion Mailing List
> > For list archives: http://lists.mysql.com/maxdb
> > To unsubscribe:
> > http://lists.mysql.com/[EMAIL PROTECTED]
> >
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>
>
Thank you for your reply.
We have analized all process of locking records during transaction and
we are sure that it is not problem with locking records. We would like to
present you some examples which show this problem .
I have writen simple application which UPDATE the same record many times
during the same transaction . It use one TDatabase component (Database1)
and two TQuery components (Query1,Query2) .
FIRST EXAMPLE:
Database1->StartTransaction();
try
{
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("UPDATE KASY SET STAN_KASY = 1000 WHERE NUMER_KASY = 0");
Query2->ExecSQL();
Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add("SELECT * FROM MAGAZYN");
Query1->Open();
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("UPDATE KASY SET STAN_KASY = 2000 WHERE NUMER_KASY = 0");
Query2->ExecSQL(); - !!!!! this instruction holds transaction on several
minutes !!!!
Database1->Commit();
}
catch (...)
{
Database1->Rollback();
}
As the resault all transaction lasts several minutes but It should lasts
only several miliseconds.
SECOND EXAMPLE:
Database1->StartTransaction();
try
{
Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add("SELECT * FROM MAGAZYN");
Query1->Open();
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("UPDATE KASY SET STAN_KASY = 1000 WHERE NUMER_KASY = 0");
Query2->ExecSQL();
Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add("SELECT * FROM MAGAZYN");
Query1->Open();
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("UPDATE KASY SET STAN_KASY = 2000 WHERE NUMER_KASY = 0");
Query2->ExecSQL(); - !!!!! this instruction execute correctly !!!!
Database1->Commit();
}
catch (...)
{
Database1->Rollback();
}
As the resault all transaction lasts several miliseconds.When we have added
one SELECT instruction which get records from any table Transaction execute
correctly and very fast.
We have oberved that this problem appear only when we UPDATE the same record
many times during the same transaction. We would like to know it is
restriction or bug.
Because we chose SAPDB (MAXDB) as database platform for our commercial
application this problem is important for our company.
I will be grateful for all suggests and advices concerning with this
problem.
Regards
Andrzej Kazmierkiewicz
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]