Board index » cppbuilder » transaction lock

transaction lock


2006-04-15 11:54:58 PM
cppbuilder57
Hello all,
I have open same table on 2 different transactions.
select * from table1;
then I
insert into the table
and then I post but I don't commit transaction yet.
then I need to open table1 on another transaction,
I can open it, but I need to post as well,
and here the problem comes.
if I post I get transaction lock error.
as well, I don't understand why because all primary key's and unique key's
used are different on first post, and second post.
I really need to open it 2 times, can you tell me how to do it please???
best regards.
 
 

Re:transaction lock

I'm sorry I posted it in wrong newsgroup....
I wanted to post it to
borland.public.interbase.general
I don't want to violate rules, and post it again,
so if administrator's of forum can, maybe you could change the post yourself
for me please???
Best regards.
 

Re:transaction lock

The news server does not allow moving a message between groups. Post a new
copy of your message in the group where you believe it should be located.
. Ed
Quote
George Goglidze wrote in message
news: XXXX@XXXXX.COM ...
I'm sorry I posted it in wrong newsgroup....

I wanted to post it to
borland.public.interbase.general

I don't want to violate rules, and post it again,
so if administrator's of forum can, maybe you could change the post
yourself for me please???
 

{smallsort}

Re:transaction lock

Hello all,
this post was already posted (by mistake) to
borland.public.cppbuilder.students
and as per my petition, I was allowed to post it again on this newsgroup...
----------------------
I have open same table on 2 different transactions.
select * from table1;
then I
insert into the table
and then I post but I don't commit transaction yet.
then I need to open table1 on another transaction,
I can open it, but I need to post as well,
and here the problem comes.
if I post I get transaction lock error.
as well, I don't understand why because all primary key's and unique key's
used are different on first post, and second post.
I really need to open it 2 times, can you tell me how to do it please???
best regards.
 

Re:transaction lock

George Goglidze wrote:
Quote
Hello all,
this post was already posted (by mistake) to
borland.public.cppbuilder.students

and as per my petition, I was allowed to post it again on this
newsgroup...

----------------------
I have open same table on 2 different transactions.

select * from table1;
then I
insert into the table
and then I post but I don't commit transaction yet.

then I need to open table1 on another transaction,
I can open it, but I need to post as well,
and here the problem comes.
if I post I get transaction lock error.

as well, I don't understand why because all primary key's and unique
key's used are different on first post, and second post.

I really need to open it 2 times, can you tell me how to do it
please???

best regards.
You need to provide more information.
What is the exact text of the error message?
Is the second transaction trying to change the record that was
inserted by the first transaction?
Two transactions can insert or update different rows at the same time
so we need to know exactly what you are doing.
--
Bill Todd (TeamB)
 

Re:transaction lock

"George Goglidze" < XXXX@XXXXX.COM >skrev i
Quote
if I post I get transaction lock error.

The same happened for me when I have fiddled with the transaction property.
After I change it to Read_Committed it worked again.
(double-click on the Transaction component to open the editor)
/ia
 

Re:transaction lock

No it's not about transaction properties.
I have it Read Commited.
but thanks for your answer anyway.
 

Re:transaction lock

Hi Todd,
many thanks for answering.
here's is more exact example.
database part
=========================
table1 has columns.
ID, INVOICE_NUMBER, AMOUNT
primary key = ID, unique = INVOICE_NUMBER
table2 hasd columns
ID, TABLE1_INVOICE_NUMBER, OTHER_FIELDS
primary key = ID, foreign key = TABLE1_INVOICE_NUMBER points to table1
INVOICE_NUMBER.
=========================
application part
=========================
IBqry1->SQL->Text="select * from table1 where INVOICE_NUMBER=:MYNUMBER";
Generator Field = on server by 1 table1_gen.
IBqry2->SQL->Text="select * from table2 where
TABLE1_INVOICE_NUMBER=:MYNUMBER";
IBqry1->Params->Item[0]->AsString=Edit1->Text;
IBqry2->Params->Item[0]->AsString=Edit1->Text;
IBqry1->Open();
//ERROR only appears if I have another instance of program open, and try to
write to the same table.
if(IBqry1->IsEmpty())
{
//HERE I HAVE A PROBLEM WHEN I POST();
IBqry1->Insert();
IBqry1->FieldByName("INVOICE_NUMBER")->AsString=Edit->Text;
IBqry1->Post();
//error: EIBInterBaseError with message 'lock conflict on no wait
transaction deadlock'.
IBqry1->Edit();
}
else
{
//HERE I HAVE NO PROBLEM AT ALL, IF RECORD ALREADY EXISTED THEN IT ALL GOES
FINE.
IBqry1->Edit();
}
IBqry2->Open();
this is how I open database (more or less)...
then when I save the database (by the way it's not in CachedUpdates mode,
it's in normal mode).
so when the record already existed it works fine.
but if I open one record in program.
then I start program on another computer, or run another instance of
program.
and try to insert into the same table, but ofcourse different number of
INVOICE_NUMBER in table1,
I get this error: EIBInterBaseError with message 'lock conflict on no wait
transaction deadlock'.
=========================
sorry the post came up to be quite big.
but I'd really appreciate someone helping me.
many thanks...
 

Re:transaction lock

"George Goglidze" < XXXX@XXXXX.COM >skrev i
Quote
Hi Todd,

//HERE I HAVE NO PROBLEM AT ALL, IF RECORD ALREADY EXISTED THEN IT ALL GOES
FINE.

then when I save the database (by the way it's not in CachedUpdates mode,
it's in normal mode).

so when the record already existed it works fine.
but if I open one record in program.
then I start program on another computer, or run another instance of
program.

I don't see any commit after your post
 

Re:transaction lock

You don't see any commit after my post, because I don't commit.
if I commit then there's no problem.
If you want my full code with all commits and full database, it'll be really
big file to look into.
I just posted the text where I have the problem...
 

Re:transaction lock

George Goglidze wrote:
Quote
EIBInterBaseError with message 'lock conflict on no wait transaction
deadlock'
That error occurs when a transaction tries to update a row that has
been modified by another uncommitted transaction.
What type of component are IBqry1 and IBQry2?
--
Bill Todd (TeamB)
 

Re:transaction lock

"Bill Todd" < XXXX@XXXXX.COM >skrev i meddelandet news:4443c321$ XXXX@XXXXX.COM ...
Quote
George Goglidze wrote:

>EIBInterBaseError with message 'lock conflict on no wait transaction
>deadlock'

That error occurs when a transaction tries to update a row that has
been modified by another uncommitted transaction.

He say it works when there's records in the table
could it be the whole table gets locked when it's empty ?
when there's no row to lock.
/ia
 

Re:transaction lock

Ingvar Anderberg wrote:
Quote
He say it works when there's records in the table
could it be the whole table gets locked when it's empty ?
when there's no row to lock.
I have never heard of that but anything is possible.
--
Bill Todd (TeamB)
 

Re:transaction lock

they are IBX components.
when I try to open a record with same number in INVOICE_NUMBER
then it's normal that it says it's locked the record.
but if I open 2 different numbers (it's unique number), then it shouldn't
give me this error...
many thanks for trying to solve my problem to both of you!!!
 

Re:transaction lock

Nono no,
sorry for my english,
maybe I didn't explain myself good.
I don't say it works when there are records in table.
I ment to say,
that in first application, if I open a record, that was already Commited,
(saved) before,
then in another computer, I can Post new record, with different number.
but if I open new record, then in second application I cannot do it.