Spring Batch
  1. Spring Batch
  2. BATCH-452

Msqld type creation script doesn't work on mysql 5.0.45

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0.m5
    • Fix Version/s: 1.0.0.rc1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      MacOs 10.5.2, MySQL 5.0.45

      Description

      Hi,

      mysql fails to create the tables for the spring-batch-core, because there are small errors inside the sql script.

      CREATE TABLE BATCH_JOB_INSTANCE (
      JOB_INSTANCE_ID BIGINT unsigned PRIMARY KEY ,
      );

      CREATE TABLE BATCH_JOB_EXECUTION (
      JOB_INSTANCE_ID BIGINT NOT NULL,
      constraint JOB_INSTANCE_EXECUTION_FK foreign key (JOB_INSTANCE_ID)
      references BATCH_JOB_INSTANCE(JOB_INSTANCE_ID)
      );

      The column JOB_INSTANCE_ID is defined as an unsigned BIGINT in the table TABLE BATCH_JOB_INSTANCE. But the referencing column inside the CREATE TABLE BATCH_JOB_EXECUTION is not defined as an unsigned BIGINT.

      Unfortunately mysql throws an erno:150, because of the type mismatch between the target and the reference. We should change the type of all references to the column JOB_INSTANCE_ID to an unsigned BIGINT.

      Another issue is the table engine definition, actually mysql uses the default table engine (InnoDB, MyIsam). We should set the InnoDB as the engine for all tables except the last ones which are used for primary key generation (they must use the myisam engine).

      Thanks
      Agim

        Activity

        Hide
        Agim Emruli added a comment -

        Dave

        MyIsam is the default store engine, so by default you will not have any acid functionality. That is the reason why i think that we should deliver the DDL script with InnoDB as the storage engine for the particular tables, because i think (not 100 % sure) that Spring Batch relies on acid guarantees.

        Thanks
        Agim

        Show
        Agim Emruli added a comment - Dave MyIsam is the default store engine, so by default you will not have any acid functionality. That is the reason why i think that we should deliver the DDL script with InnoDB as the storage engine for the particular tables, because i think (not 100 % sure) that Spring Batch relies on acid guarantees. Thanks Agim
        Hide
        Dave Syer added a comment -

        I updated the timestamps and the bigints.

        I still don't understand the innoDB thing. If that is the default why do we have to explicitly specify it (and why won't it work for all tables)? We certainly want full isolation.

        Show
        Dave Syer added a comment - I updated the timestamps and the bigints. I still don't understand the innoDB thing. If that is the default why do we have to explicitly specify it (and why won't it work for all tables)? We certainly want full isolation.
        Hide
        Agim Emruli added a comment -

        Dave

        like I said before the default MYSQL storage engine is MyIsam. You can change the default storage engine to InnoDB, but that needs a configuration tweak of the DBA.
        Have a look here http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html

        Regards
        Agim

        Show
        Agim Emruli added a comment - Dave like I said before the default MYSQL storage engine is MyIsam. You can change the default storage engine to InnoDB, but that needs a configuration tweak of the DBA. Have a look here http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html Regards Agim
        Hide
        Dave Syer added a comment -

        Added type=innoDB to all the non-sequence tables. I still don't see why can't rely on the defaults, but it wasn't har to do, so you win.

        Show
        Dave Syer added a comment - Added type=innoDB to all the non-sequence tables. I still don't see why can't rely on the defaults, but it wasn't har to do, so you win.
        Hide
        Dave Syer added a comment -

        Assume closed as resolved and released

        Show
        Dave Syer added a comment - Assume closed as resolved and released

          People

          • Assignee:
            Dave Syer
            Reporter:
            Agim Emruli
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified