Transactions and child records

Hi everyone

I am an aboslute beginner with SQL transactions and record locking but can see their value for my solution. Before i start playing around with these i would like to understand how they work, some questions:

My forms are quite complex with tab panels and related records in portals or tabless tab panels. The user only thinks of this as 1 record but as we all know of course there are many.

if i start the transaction with an on edit record event on the parent record what happens to the line item edits/new records?

Do they roll back or are these all separate transactions? Same with record locking.

What is the differnece between transactions like this and the new save feature in 3.0? Will this be easier?

What if i use multiple tabpanels, where do i start the transaction?

Would really appreciate any advice.

I’m new to SQL transactions, too. I’m secretly hoping that someone on the Servoy team (like Bob Cusick) would offer a downloadable file that explains how to implement transactions properly. Or maybe modify an existing demo file to support transactions.

I have a complex Filemaker solution that I’d like to migrate to Servoy, and since the solutions involves patient data, I personally think it’s critical to add/edit patient data using transactions.

Sean

Hi Guys,

Transactions in Servoy are very simple:

  1. One single transaction will work across multiple databases and tables (it has to - becuase of tabpanels and portals);

  2. You start the transaction anytime and “commit” or “rollback” anytime;

  3. NOTHING is saved to the backend (other users cannot see data changes) until you commit;

  4. The new feature in 3.0 - is basically the same thing as starting a transaction on startup. NOTHING is committed until you save the data.

Hope this helps.

Hi Bob,

That sounds very straightformward. FileMaker has a Revert Record/Commit Record feature, but it’s rather clunky IMO. For example, if you inadvertently click outside a field during data entry (or switch to another layout), FileMaker will either:

a) auto-commit the record, or
b) display an annoying “Save changes to layout” dialog

What exactly is this new feature in 3.0 that you mentioned, and how is it an improvement over 2.x (I’m new to Servoy, so I don’t know how transactions were handled in 2.x)?

Regards,
Sean

Here is a little sample solution.

The new feature is that you can set autosave to true or false, this way the user can change data and it wil only be saved to the server by command. By doing this you can limit the datatrafic.

lock_transaction_test.servoy (41.9 KB)

hi sanneke,

Thanks for the sample file.

By the way, I’m also trying to understand the record locking features of Servoy. Do you have a sample for that as well?

Regards,
Sean

Hi Sean,

In the sample solution is also a sample of record locking, on one form there is a sample of related records and locking.