Databases and Xojo API 2.0 And Why I’m not Using it Yet

Now that API 2.0 is more or less been through two releases (2019 R2.1 and 2019 R3) many Xojo developers are starting to poke around with API 2.0 in their database applications.  There are many things to like about the changes to the database classes and our own ActiveRecord class does many of these things.  Things like throwing exceptions when there are errors definitely get your attention whereas in API 1.0 unless you check for the error you may not know anything bad happened.  The built-in Prepared Statements are a super nice change too.

Despite all the good things with the db classes in API 2.0 I recommend holding off until one, very important bug, is fixed.  Feedback case 58739 is such a huge risk that you simply cannot use the new API 2.0 classes in your Xojo projects yet.

The essential detail of that case is that Xojo is not releasing objects as it should.  Norman did a test case and showed that when using API 1.0 his test project had 24 objects at the end of the test run.  Doing the same thing in API 2.0 had over 43 million still unreleased objects!  This means there is a huge use of memory in the application and in 32-bit applications it will simply crash once it consumes 4 GB of RAM.  64-bit applications will last longer but still bring your computer to its proverbial knees.  

The Feedback case talks about SQLite and in-memory databases but other reports are that it’s in other databases as well including ODBC and MS SQL Server (case 57978).  The good news is that 58739 is marked as fixed as of January 7th, 2020 (57978 has not been updated).  But unless Xojo issues a point release to 2019 R3 we won’t see this fix until 2020 R1 is released and there is zero evidence of that happening any time soon.

Several people have contacted us about an updated ARGen that generates API 2.0 code.  We are holding off until we feel API 2.0 is rock solid.  So until this is fixed we are not using or advocating for API 2.0.

Have you found anything else in API 2.0 that should discourage Xojo developers from using it?

5 thoughts on “Databases and Xojo API 2.0 And Why I’m not Using it Yet

  1. Case 58739 is showing “This case has been fixed and is waiting verification from our testing staff.” as of yesterday!

    • I believe I said that! But really, the question for such an egregious bug is *when* will we get a release. Hopefully not in March but a lot sooner.

    • That‘s what I call a showstopper bug and should be released as a point update as it makes a release pretty much unusable.

  2. I would like to have monthly bug-fix releases. So there would be a 2019R3.1 in January, a 2019R3.2 in February and so on, with no new features, just fixes.
    Then, let’s say wenn Xojo version 2020R1 is released with new features in March, the cicle begins again with 2020R1.1 in April…

  3. For production it’s a bad idea to use API 2.0 right now is my opinion.
    I will stick to 2019R1.1 for the time being.
    But if no one plays with the latest releases it will never get rock solid.
    It’s the way API 2.0 has been brought to us which does not deserve a beauty prize and gives little confidence. Hope they will focus on stability and stability and stability. Downside for API 1.0 users is that bug will probably never get any attention anymore. Just learn to live with it.

Comments are closed.