Using DB2zDialect results in Name cannot be null

When i change my quarkus 3.20.2.2 application to use DB2zDialect, i get this error:

java.lang.IllegalArgumentException: Name cannot be null.

The reason for this, is that out seqname column is blank in select * from sysibm.syssequences

According to this documentation: SYSSEQUENCES catalog table - IBM Documentation,

“For a sequence alias, identifies the schema of the sequence for which the alias is defined. Otherwise, the value is blank.”

So based on this documentation is completely allowed for a seqname to be blank, but currently the code actually results in the above error, because org.hibernate.boot.model.naming.Identifier returns null, when it get an empty string. So the result is that the application cannot start ;-(

The above problem has been identified in both version 6.6.17 and 7.1.0.Final of hibernate-core.

I know that i can extend the DB2zDialect, and return null in getQuerySequencesString, which ensures that i cannot use sequences, but i do not feel this is the correct solution for this.

Any inputs?

Hi, we recently fixed similar sounding issues for DB2iDialect via HHH-19453. The problem with DB2i and DB2z ultimately is that we can’t test these dialects at this time. We don’t have such machines, so errors like the one I linked are possible.
If you could provide a more in depth analysis about what you think is wrong and create a Jira issue, we’d try to look into this as soon as possible, such that you can upgrade to the latest Hibernate ORM version and use that.

Thanks Beikov.

I will create a PR that corrects this.

How can i create an issue in your jira. I do not have access to this?

In the meantime, i have created a PR here: Db2z dialect sequences fixed by dankristensen · Pull Request #11006 · hibernate/hibernate-orm · GitHub maybe you can create the jira issue @beikov and ensure this get’s merged. Would it make sense to have this merged into earlier versions?

You go to https://hibernate.atlassian.net and click on the right top icon which will send you to a login/signup page. After that, you should be able to create Jira issues for the Hibernate project.

Thanks for the PR, I’ll take a look. I would appreciate if you could also create the Jira issue so you get credit for the contribution and know what to do the next time you encounter a problem :slight_smile:

I agree that backporting to earlier branches makes sense and once we merged it to the main branch, I will work on the backports.

I have updated the PR, with your suggestions.

I have tried logging in, and try to create an issue. Then i get this error:

Hash D7WM12
Trace 8daa40f928bc4a46a4f985ca39ce78cc

It is ok for me, if you just create the issue

Can you please try again? Atlassian admitted some trouble on their side as part of JST-1182962 which should be fixed now AFAIU.

I tried again, without success. Same error as Yesterday. Cannot even get anything on the link you are referring to.

I succeeded. I had to login twice, in order to be able to create an issue. Issue is here: Jira

1 Like