nuodb / migration-tools

Migration tools for NuoDB
http://nuodb.github.com/migration-tools/
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

[MIG-164] Take table locks when ENFORCE_TABLE_LOCKS_FOR_DDL is true #48

Closed db2882 closed 5 years ago

db2882 commented 5 years ago

Versions 3.2 and 3.3 have a system property, ENFORCE_TABLE_LOCKS_FOR_DDL, that causes an exception to be thrown if certain DDL statements are executed without a lock on the table. Modify migrator so that it takes a table lock before executing those DDL statements if loading into a NuoDB database running one of those two versions with table lock enforcement enabled.

Note that in 3.2 the system property, TRANSACTIONAL_LOCKS, must be set to true in order to take a table lock. Migrator will not set that property to true automatically so users loading into a 3.2 database with ENFORCE_TABLE_LOCKS_FOR_DDL set to true must also ensure they have set TRANSACTIONAL_LOCKS to true.

Modified the integration test matrix to exercise loading into databases both with and without table lock enforcement enabled.