-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes transaction handling within changesets on DB2 on z/OS #3342
Conversation
public Db2zDatabase() { | ||
|
||
Db2zDatabase() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the public from this? I think that will keep this extension from being loaded by the ServiceLoader, because it needs a public no-arg constuctor.
Thanks for the follow-up on the transaction logic on db2/z, @MichaelKern-IVV. Unrelated question but while I have you: is the |
@nvoxland I have now removed the Db2zDatabase construtor completely since it only made the same settings as AbstractDb2Database. |
@nvoxland There are three "special registers" to obtain time information: `DB2 => select current time t, current date d, current timestamp ts from sysibm.sysdummy1 T D TS 10.08.24 2022-10-07 2022-10-07-10.08.24.144289 1 Satz/Sätze ausgewählt.` As far as I remember (and as long as the IBM documentation goes back) this has always been the case and has never changed. In short I think |
Thanks for the info and thanks for the extra commits, @MichaelKern-IVV . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and test results:
Things to be aware of:
- Only impacts db2 on z
Things to worry about:
- Nothing, contributor answered the questions I had
@filipelautert, hello! I'm moving this ticket back to Development as the PR is not building for some reason. I'll keep an eye out to see when this comes back to code review. Thanks! |
Hi @XDelphiGrl - now it is building fine :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this PR, Liquibase now honors DDL transactions for the DB2/Z database.
- No additional testing required.
APPROVED
Impact
Description
Erroneous ChangeSets are not always completely rolled back.
Fixes #3299
This is the case because unnecessary and therefore erroneous commits are performed under DB2z. And because liquibase does not honor that DB2z supports DDL in transactions.
Things to be aware of
I executed a test script:
`DB2 => connect to db2eha user a61kern
Aktuelles Kennwort für a61kern eingeben:
Datenbankverbindungsinformationen
Datenbank-Server = DB2 z/OS 12.1.5
SQL-Berechtigungs-ID = A61KERN
Aliasname der lokalen Datenbank = DB2EHA
DB2 => create table test1 (id integer not null primary key, name varchar(20))
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => comment on table test1 is 'Table for auto commit test'
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => insert into test1 values (1, 'Test 1')
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => select * from test1
ID NAME
1 Satz/Sätze ausgewählt.
DB2 =>
DB2 => commit
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => create table test2 (id integer not null primary key, name varchar(20))
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => comment on table test2 is 'Another Table for auto commit test'
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => insert into test2 values (1, 'Test 2')
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => select * from test2
ID NAME
1 Satz/Sätze ausgewählt.
DB2 =>
DB2 => rollback
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
DB2 => select * from test1
ID NAME
1 Satz/Sätze ausgewählt.
DB2 =>
DB2 => select * from test2
SQL0204N "A61KERN.TEST2" ist ein nicht definierter Name. SQLSTATE=42704
DB2 =>
DB2 => connect reset
DB20000I Der Befehl SQL wurde erfolgreich ausgeführt.
DB2 =>
`
It can be observed from the outputs that
Things to worry about
I only have access to a DB2z 12 and cannot verify for older versions if the behavior is the same.
All the people I have talked to, especially the DB2z administrators in the company, have claimed that the behavior has always been like this and has never been modified.