• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.7, 3.9
    • 2.4, 2.5
    • Kernel

      Add support for HSQLDB databases for use with user/group/rights/cache management, etc.

          [RUNTIME-897] Add support for HSQLDB in CMS

          Ken Yeo added a comment -

          You're welcome. I'll take a look at the forms and survey plugins when time permits. Thanks.

          Ken Yeo added a comment - You're welcome. I'll take a look at the forms and survey plugins when time permits. Thanks.

          Note that both plugins forms and survey perform a test on the db type during their processing.
          To have full hsqldb support, we also have to patch these plugins.
          I'll open related issues.

          Cédric Damioli added a comment - Note that both plugins forms and survey perform a test on the db type during their processing. To have full hsqldb support, we also have to patch these plugins. I'll open related issues.

          Committed in trunk

          I've added unit tests

          Thanks again for the patches !

          Cédric Damioli added a comment - Committed in trunk I've added unit tests Thanks again for the patches !

          Ken Yeo added a comment -

          You're welcome. I'm proud of the contribution I made since I'm a Java beginner.

          Anyway, I still need help with using HSQLDB for the repository. I tried using BundleDbPersistenceManager class as a persistence manager for HSQLDB, but I kept getting NODE_ID and NODE_ID_HI errors.

          Ken Yeo added a comment - You're welcome. I'm proud of the contribution I made since I'm a Java beginner. Anyway, I still need help with using HSQLDB for the repository. I tried using BundleDbPersistenceManager class as a persistence manager for HSQLDB, but I kept getting NODE_ID and NODE_ID_HI errors.

          I'll mark the issue as resolved as soon as your patch are committed.
          I'll write some unit tests too.

          By the way, thanks for the patches.

          Cédric Damioli added a comment - I'll mark the issue as resolved as soon as your patch are committed. I'll write some unit tests too. By the way, thanks for the patches.

          Ken Yeo added a comment -

          I think the runtime works fine with HSQLDB even though I didn't perform unit tests. Can this issue be closed as resolved? I hope the patches make it into the release.

          Ken Yeo added a comment - I think the runtime works fine with HSQLDB even though I didn't perform unit tests. Can this issue be closed as resolved? I hope the patches make it into the release.

          Ken Yeo added a comment -

          Attached are more patches related to using HSQLDB for group/profile management

          Ken Yeo added a comment - Attached are more patches related to using HSQLDB for group/profile management

          Ken Yeo added a comment -

          I don't know how to perform the test yet. Instead, I created an empty HSQL database, HSQLDB scripts and a config file for others to perform the test.

          Ken Yeo added a comment - I don't know how to perform the test yet. Instead, I created an empty HSQL database, HSQLDB scripts and a config file for others to perform the test.

          Nicolas Gavalda (Inactive) added a comment - - edited

          Seems nice. If you want the work to be complete (for the Runtime part), you can take a look at the unit tests located in the test folder of the Runtime project (DerbyXxxTestCase).
          The tests should be simple enough to adapt, the only differences between the DBMS are:

          • the JDBC connection info in the test/environments/configs/config_xxx.xml configuration file
          • some SQL scripts used by the tests in the test/environments/scripts/jdbc-xxx directory

          Setting up an environment to run the tests is complex, but the tests should run fine if the SQL scripts can be run in a HSQLDB database.

          Nicolas Gavalda (Inactive) added a comment - - edited Seems nice. If you want the work to be complete (for the Runtime part), you can take a look at the unit tests located in the test folder of the Runtime project (DerbyXxxTestCase). The tests should be simple enough to adapt, the only differences between the DBMS are: the JDBC connection info in the test/environments/configs/config_xxx.xml configuration file some SQL scripts used by the tests in the test/environments/scripts/jdbc-xxx directory Setting up an environment to run the tests is complex, but the tests should run fine if the SQL scripts can be run in a HSQLDB database.

          Ken Yeo added a comment -

          Thanks, Nicolas
          The patch seems to get rid of the "statement not in batch mode" error.
          At this moment, I don't get any more error related to using HSQLDB.

          Ken Yeo added a comment - Thanks, Nicolas The patch seems to get rid of the "statement not in batch mode" error. At this moment, I don't get any more error related to using HSQLDB.

          Ken Yeo added a comment -

          Here's the HSQLDB script I made for Ametys CMS. Without quotation marks, all tables and column names become uppercase, but they all work because Ametys don't quote queries anyway.

          Ken Yeo added a comment - Here's the HSQLDB script I made for Ametys CMS. Without quotation marks, all tables and column names become uppercase, but they all work because Ametys don't quote queries anyway.

          Here's a patch that may resolve your "statement not in batch mode" problem.

          Nicolas Gavalda (Inactive) added a comment - Here's a patch that may resolve your "statement not in batch mode" problem.

          Could you provide the SQL scripts you adapted as well, please?

          Nicolas Gavalda (Inactive) added a comment - Could you provide the SQL scripts you adapted as well, please?

          Ken Yeo added a comment -

          I get this error when I work in the group management page.

          org.hsqldb.HsqlException: statement is not in batch mode

          Ken Yeo added a comment - I get this error when I work in the group management page. org.hsqldb.HsqlException: statement is not in batch mode

          Ken Yeo added a comment -

          Okay, XML-based configuration sounds good. But I don't know how to write such a XML file. Is there a reference template for DBMS-validation queries?

          Ken Yeo added a comment - Okay, XML-based configuration sounds good. But I don't know how to write such a XML file. Is there a reference template for DBMS-validation queries?

          Ken Yeo added a comment -

          New runtime with patched ConnectionHelper.class and DataSourceExtensionPoint.class

          Ken Yeo added a comment - New runtime with patched ConnectionHelper.class and DataSourceExtensionPoint.class

          As an alternative to hardcoding the new validation query, in RUNTIME-896 it's proposed to make the DMBS-validation query mapping a configuration file, which would be more clean and extensible.

          Nicolas Gavalda (Inactive) added a comment - As an alternative to hardcoding the new validation query, in RUNTIME-896 it's proposed to make the DMBS-validation query mapping a configuration file, which would be more clean and extensible.

            Unassigned Unassigned
            kenjoey Ken Yeo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: