It’s been a while since I looked at it but since the examples are very single record add/edit/delete I would bet that DBKit is just using the default transaction. IIRC the example (Eddies?) doesn’t do multiple deletes and certainly does no multiple updates.
It gets ugly quickly if you get into scenarios where User 1 puts a filter on a customers list with the last name of smith and gets interrupted by a phone call. User2 opens a Smith record and changes the last name to Smyth and saves. User1 gets back to his desk and then completes the operation by selecting all and Deleting. The record is deleted even though it no longer matches the filter because there’s no record locking and the list doesn’t know that a change has updated a record. Frankly, this type of scenario is very tough to protect against - not just DBKit.
Personally, I’ve found it way better to mark records as ‘deleted’ and just filter them out out via SQL. That way an average user can’t really delete data. And if they do mark it as deleted by accident it’s easy to recover by an admin. Truly deleting ‘important’ data should be rare, IMO. But then you can also get into Audit Trails and things like that. Some of that was easy with ActiveRecord because we had the before/after events for Create, Update, Delete.
But, since Geoff has never made a complex, multi-user db application he just doesn’t think about shit like this or never encountered it. I have limited FileMaker and 4D experience but I’d hazard a guess that they HAVE considered situations like this in multi-user environments and have ways to protect the user from themselves. Granted, it may not be default behavior but I’m guessing it’s somewhere in there.
Regardless, DBKit is a joke without all the considerations that we already thought of. Surely there are many more if we thought about it more. Geoff wants the ‘easy button’ when in reality there’s a bunch of things that need to go into it so that it’s easy AND safe all the way from development and into production.
4d has always had pessimistic locking. It’s had transactions since sometime in the early days.
it added optimistic locking, record stamps, global stamps, record merging, etc., when it introduced its own ORM, called ORDA, around 2017 or so.
the way you would handle this sort of situation, today is either by:
using pessimistic locking (the records are locked when they are touched, unless the process states otherwise), until the record is released.
use stamps/merging/optimistic locking - each user/process gets a copy of the record. process 1 modifies the user’s last name, and merges the changes. process 2 tries to delete the record. if process 2 did not tell the database to ignore the record stamp, the delete will fail, because the record was modified by process 1, after process 2 fetched a copy of it. the solution is either to delete the record and ignore the stamp (which has to be done, explicitly), or reload the record (which will grab the current stamp), and then delete it.
on the opposite end, with optimistic locking, you can save the record and ask the db to auto-merge the changes (assuming that there is no conflict, and that the record was not locked, pessimistically). if there is an error, the only option is to reload the record, reapply the changes, and attempt to save it, again. that sounds awkward, but because of the way 4d handles records in its ORM, where you only ever have a copy of the record, copy “a” would be the one you were trying to save, and copy “b”, is the record reloaded, with the new stamp. then you can just diff the two, apply the original changes to “b” and save, again.
Thanks. That’s a good explanation of record locking. You’d think Geoff being an old 4D trainer would at least understand pessimistic record locking but, then again, I would imagine that’s not a typical training topic or if it is it’s not covered in detail. Regardless, DBKit could do all of this but it would require a level of detail that Geoff doesn’t think is important and a level of effort he’s not capable of.
sadly, i’m old enough to remember when geoff was at 4d. record locking was definitely a thing, at the time. in fact, i’m pretty sure he was there when we were discussing using triggers to overcome deadly embrace when records were locked.
Yes it is just a Delutional problem. At some point xojo was kind of better than the alternatives. Then he disconnected from the world, lost sight of the competence and still believes it has a PRO wich is decades outdated on MOST areas.
.NET is free and it can do MUCH MORE than xojo. The only thing xojo has is the old RADish way of doing things.
I tried it about 18 months ago and still get update notices
I’m just not writing the apps I had thought I might using Blazor
There is still an opportunity to do so
It has Linux, Mac and Windows IDE BUT PRODUCES WE APPS ONLY!!! AND ITS NOT AN ALTERNATIVE TO C#. It is C#. At the end you’ll get an App for an IIS Server. You really want that? Oky, then go for it. But it is nothing else but with a visual Designer.
You could have that for free with Vaadin. And with so many other solutions. There is no real 4D. To have what you want and need you will be editing code at the end. There is no chance otherwise. Looks bright. Shiny. Like las Vegas Strip. But behind the doors you have not that big ability to write applications. If you web only devloper: good solution. If not: wasting of time cause no chance for code reuse. Not a good Idea.
If I was the same age I was when I started using RealBasic, with the choices now available, I’d certainly look around before deciding. But at the time there weren’t many/any, and now I’m too old to learn new things
If it fits your needs there is no need to change. Definitely not. But I had never the chance to use it. I had to use for the electronics anyhow C and >C++ so I was landing at Java for Desktop and Web. Things are like this always. No choice ic no choice.
Telling yourself you’re too old to learn things isnt true
Or a fair assessment of your skills etc
Now if you said it would take me too long to learn something new & get to the same level of skill as I am with Xojo - fair
You, like me, have a couple decades experience with Xojo
So yeah it takes time to get there
But it can be done
And the resources for other toolsets & languages are vast
And the IDEs ? … world different and actually have AI help in them thats amazing
She decided to define it so. That’s why I was not reacting in this wise. I have a friend which learned in his age of 79 RUST while it was interesting for him to use with esp32 devices. So I guess that will be always possible. But you need time. And what if you don’t wamnt to spend the time before one day retiring? But yes, not able to can’t be true. More not the time or different priorities.