TMyTable delete error if in state DSEdit
TMyTable delete error if in state DSEdit
Is that a bug or a feature:
I use a TMyTable
1. Insert a record
2. post
3. set the state to edit
4. delete the record
Behaviour: the record is not being deleted.
Is that the expected behaviour?
I use a TMyTable
1. Insert a record
2. post
3. set the state to edit
4. delete the record
Behaviour: the record is not being deleted.
Is that the expected behaviour?
Re: TMyTable delete error if in state DSEdit
Unfortunately, we are unable to reproduce the problem in our environment based on the information you provide.
In order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html including the scripts for creating database objects. Also specify the version of the MySQL server that you are using.
In order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html including the scripts for creating database objects. Also specify the version of the MySQL server that you are using.
Re: TMyTable delete error if in state DSEdit
Sorry I don´t have the time at the moment.
We fixed the problem by adding a post to the table before we delete (berfore delete function) the row.
We fixed the problem by adding a post to the table before we delete (berfore delete function) the row.
Re: TMyTable delete error if in state DSEdit
We've sucessfully deleted a row with the following code:
We couldn't reproduce the issue without a sample project, unfortunately. We would greatly appreciate it if you would send us a sample project.
Code: Select all
MyTable.TableName := 'DEPT';
MyTable.Open;
MyTable.Insert;
MyTable.Fields[0].AsInteger := 1;
MyTable.Post;
MyTable.Edit;
MyTable.Fields[0].AsInteger := 2;
MyTable.Delete;
Re: TMyTable delete error if in state DSEdit
Thanks for investigating .... then there might be a side issue in my code!
Re: TMyTable delete error if in state DSEdit
Code: Select all
Kopf.Insert;
KopfSumme.AsFloat:=10000;
Kopf.Post;
Kopf.Edit;
KopfSumme.AsFloat:=20000;
Kopf.Delete;
That is exactly what I am doing.
The row with the 10000 value stays in the table after the delete command. If I add a post before the delete - everything is fine !!!
Re: TMyTable delete error if in state DSEdit
My MySQL Setup:
Server: Localhost via UNIX socket
Server-Typ: MySQL
Server-Version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
Server: Localhost via UNIX socket
Server-Typ: MySQL
Server-Version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
Re: TMyTable delete error if in state DSEdit
I think this will help:
this works:
[img]htts://www.honscha.de/withpost.jpg[/img]
that fails:
[img]htts://www.honscha.de/withoutpost.jpg[/img]
this works:
[img]htts://www.honscha.de/withpost.jpg[/img]
that fails:
[img]htts://www.honscha.de/withoutpost.jpg[/img]
Re: TMyTable delete error if in state DSEdit
Unfortunately, we are unable to reproduce the issue in our environment based on the information you provide. Perhaps the reason is in the settings of the component or server.
In order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html
In order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html
Re: TMyTable delete error if in state DSEdit
Did you check the DBMonitor output?
Re: TMyTable delete error if in state DSEdit
Yes, they are different from your screenshots. Therefore, we asked to send an example to understand what properties you have set for our components.
Re: TMyTable delete error if in state DSEdit
Try this and you can reproduce the error:
Code: Select all
Kopf.LockMode:=lmPessimistic;
Kopf.RefreshOptions:=[roBeforeEdit];
Kopf.Insert;
KopfSumme.AsFloat:=10000;
Kopf.Post;
Kopf.Edit;
KopfSumme.AsFloat:=20000;
// Kopf.Post;
Kopf.Delete;
Re: TMyTable delete error if in state DSEdit
Thank you for the information.
We've fixed the issue with transaction commiting when LockMode = lmPessimistic. The fix will be included in the next version MyDAC, which we're planning to release this week or early next week.
We've fixed the issue with transaction commiting when LockMode = lmPessimistic. The fix will be included in the next version MyDAC, which we're planning to release this week or early next week.
Re: TMyTable delete error if in state DSEdit
That is great news ... maybe you could release the code as soon as possible so I can patch my projects.
Re: TMyTable delete error if in state DSEdit
If you need a night build for another IDE please provide the IDE version to us using contact form https://devart.com/company/contactform.html and we will send you a night build.