TOracleDataset.insert but state = dsBrowse

cdev

Member²
Hi

Does anybody know the possible reasons for a TOracleDataset.insert command to success (no error is raised) but not updating the TOracleDataset.state to dsInsert? Actually, it stays to dsBrowse and i get an exception when I try to post :

Code:
TClient := TOracleDataSet.Create(nil);
      Try
        TClient.CommitOnPost := False;
        TClient.QueryAllRecords := False;
        TClient.CountAllRecords := False;
        TClient.Session := FormGerer.Session;
        TClient.SQL.Text := ' Select c.*, c.rowId from PCOMCLIENT c where c.norecord = -1 ';
        TClient.Open;
	
	...	

	TClient.Insert; // --> TClient.state = dsBrowse after this point...

	...

	TClient.post; // --> Here is an exception : "datas are not in insertion mode" or something like this
      Finally
	TClient.CloseAll;
	TClient.Free;
      End;
Assuming CommitOnPost = False, is there a possibility that an old record is "blocked" in insertion waiting for a commit or a rollback and locking any other insert tentative?

Thank you for any help or advice.

CdeV
 
I cannot imagine why this would happen. I did a little test and it works as expected. Do you have any dataset events that could cause this?
 
Thanks Marco for your answer.

I haven't got the problem any more today.
I think I was right when I supposed an old record in insertion mode without any commit or rollback produce this error.

Anyway, I haven't enough time to go further in tests and it works fine now...

CdeV
 
Back
Top