Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Weird transaction occorrence
Fri, Apr 7 2006 10:03 AMPermanent Link

Samuel Costa
Hey,
i'm having some trouble with some transactions and i'd like to get some
ideas from you:

Heres what i'm doing:

try
   database.starttransaction;
   with dbtable1 then
   begin
      close;
      tablename:='table1';
      open;
      insert;
                // insert data
      post;
      close;
      tablename:='table2';
      open;
      insert;
      // insert data
      post;
      close;
      tablename:='table3';
      open;
      insert;
      // insert data
      post;
      close;
   end;
   database.commit;

except
   database.rollback;
end;

the thing is that even with transactions it writes on table3 and table2
but not on table1. Its a very rare occurrence but it happens nonetheless.
DBISAM 4.22 Build 3, Delphi 7

TIA,

Samuel Costa
Fri, Apr 7 2006 5:29 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Samuel,

<< the thing is that even with transactions it writes on table3 and table2
but not on table1. Its a very rare occurrence but it happens nevertheless.
DBISAM 4.22 Build 3, Delphi 7 >>

Could you send me an example of this (timyoung@elevatesoft.com) ?

Thanks,

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Apr 11 2006 5:23 AMPermanent Link

Samuel Costa
I can try and make you an example, but i haven't succeeded in
replicating it.
The thing is i have an autoinc field in table1 that is used as a foreign
key in the other tables. I get this value by doing
table1.LastAutoIncValue; so this autoinc value is in table2 and table3
but the value refers to either an non-existent record on table1 or a
totally different record on table1.
Wouldn't the existence of the autoinc be an indicator that the record
has been written to table1?
What would you need as an example?
Sample tables and code?

Sam

Tim Young [Elevate Software] wrote:
> Samuel,
>
> << the thing is that even with transactions it writes on table3 and table2
> but not on table1. Its a very rare occurrence but it happens nevertheless.
> DBISAM 4.22 Build 3, Delphi 7 >>
>
> Could you send me an example of this (timyoung@elevatesoft.com) ?
>
> Thanks,
>
Tue, Apr 11 2006 8:49 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Samuel,

<< I can try and make you an example, but i haven't succeeded in replicating
it. The thing is i have an autoinc field in table1 that is used as a foreign
key in the other tables. I get this value by doing table1.LastAutoIncValue;
so this autoinc value is in table2 and table3 but the value refers to either
an non-existent record on table1 or a totally different record on table1.

Wouldn't the existence of the autoinc be an indicator that the record has
been written to table1? >>

I'm not quite sure what you're asking.  If you could post or email me, at
very least, the portion of the code that is performing the transaction, then
that would be a good start.  Any tables that you have would be helpful also
so that I can refer to the metadata.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image