Hi, based on some forum posts, Servoy only has a single transaction per client. Does this mean that we cannot have 2 forms opened and do CRUD operations simultaneously in a single client instance?
Can one form perform rollback and commit without changing the status of the other form?
you can use in memory transactions (so no db transactions) for most things.
and then rollback specific records that only that window had, but you do have to know which one belongs to which “session”
jcompagner:
you can use in memory transactions (so no db transactions) for most things.
and then rollback specific records that only that window had, but you do have to know which one belongs to which “session”
Thanks for this.
How do I know in Servoy if we are using in memory transaction or database transaction?
Just be aware that using in-memory transactions doesn’t give you everything a database transaction would.
For instance a record delete is send straight to the database (yes, even with autosave off) and therefor can’t be rolled back from the in-memory transaction.
I did a small write up on it (with a workaround) on the ServoyCamp site.
ROCLASI:
Just be aware that using in-memory transactions doesn’t give you everything a database transaction would.
For instance a record delete is send straight to the database (yes, even with autosave off) and therefor can’t be rolled back from the in-memory transaction.
I did a small write up on it (with a workaround) on the ServoyCamp site.
Hope this helps.
You are right in IM transactions, if I delete a record, it won’t show again even if I call rollback syntax. Does Servoy have a workaround on this for Servoy 6? I am very concerned with the integrity of the database using IM transactions. When is IM transactions recommended for use? Is it still recommended for saving or modifying records with relations to different tables like policy, policy_has_products, policy_to_underwriter, etc?
If we use database transactions, which I can see maintains ACID properties of the db, is it safe to use a headless client to perform multiple transactions?
I know this is an old thread, but I don’t see that anyone has answered Erik’s question yet. Is there an answer?
The IM transactionms don’t seem to roll back changes to related records (edited in a table-view form, in a tab panel on the main form). Is this correct?
The IM transactions don’t seem to roll back changes to related records (edited in a table-view form, in a tab panel on the main form). Is this correct?
I discovered some mistakes in my code, and the rollback of related edits does appear to be working. Unfortunately, if the new record also creates drill-down records in the table view, turning autosave off prevents them from being displayed. Is there another approach?
if you create the record through those relations then it should work fine,
if you do that outside them, you have to save it first before the related foundset will see them
What does it mean to create the record through those relations?
Do I use something like “student_to_contact.newRecord()”, rather than “relatedTableFoundset.newRecord()”, to create the record in the contact table? Do I also need to have the tab panel with a defined relation, or can the tab panel have “none” as the relationName?
going through the relation so “relationname.newRecord()” then the relation will have the new record even before saving
If you do newRecord() through another foundset (or another relation) you other relation will not see it before saving.