Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-1446

SQL upgrade scripts - changing SessionInfo primary key column data type fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 6.2.0
    • 6.1.0
    • jBPM Core
    • None

      In database upgrade scripts, which are located in jbpm-installer module, we update data type of primary key column "id" of "SessionInfo" table. It's script jbpm-6.1-to-6.2.sql. Some database systems can do this update, but some others not.

      E.g. in SQL Server you must first drop the primary key constraint from the column and after data type change, create it again. But the constraint can be dropped only if there are no foreign key references referencing the column. So when there is a lot of data, this can be a problem.

      I'm creating this because I cannot find a "clear" solution for this case. An idea was to disable constraints temporarily, drop primary key constraint, make the data type change, enable constraints. But this can be risky, because when something fails, constraints can remain disabled.

      Tested databases where it fails:

      SQL Server 2012
      DB2 10.1

      Reproducer:

      Set up appropriate Maven properties so some failing database system is used.
      Run UpdateScriptsTest.testExecutingScripts() method from this PR:
      https://github.com/droolsjbpm/jbpm/pull/304

            kverlaen@redhat.com Kris Verlaenen
            kverlaen@redhat.com Kris Verlaenen
            Tibor Zimányi Tibor Zimányi
            Tibor Zimányi Tibor Zimányi
            Alessandro Lazarotti, Cheng Zhang (Inactive), Filippe Spolti, Rajesh Rajasekaran, Tibor Zimányi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: