Skip to content

Clarify the seed value of version#649

Draft
quaff wants to merge 1 commit into
jakartaee:masterfrom
quaff:patch-3
Draft

Clarify the seed value of version#649
quaff wants to merge 1 commit into
jakartaee:masterfrom
quaff:patch-3

Conversation

@quaff

@quaff quaff commented Aug 29, 2024

Copy link
Copy Markdown
Contributor

Supersede #600

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
Comment on lines +44 to +46
* <p>Any <strong>positive number</strong> or <strong>non-null timestamp</strong>
* initial value will be the seed of version, otherwise vendors are free to
* seed the version.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this actually addresses the real actually-known use case here which is to enable a portable way to choose between an initial version of 0 and an initial version of 1.

With this language:

@Version int version = 1;

lets me portably get an initial value of 1. OK, great.

But:

@Version int version = 0;

Just does something non-portable and vendor-specific.

So there's no portable way to request an initial value of 0.

Is that correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there's no portable way to request an initial value of 0.

Yes, there is no way to differ int version = 0; from int version;, both of them should be treated as non-predefined, if negative numbers are treated that way, why not zero?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if negative numbers are treated that way, why not zero?

Well, because counting from 0 is perfectly legit, and often used in computing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it's what Hibernate does by default, so it can't be terrible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if negative numbers are treated that way, why not zero?

Well, because counting from 0 is perfectly legit, and often used in computing.

I'm not against that if EclipseLink team would like to support counting from 0.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, so it's something that needs to be discussed properly with @lukasj and we need to think through the full impact. i.e. we need an issue to track this. We can't just make this sort of change as a PR with no discussion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need an issue to track this.

Could you reopen #600?

@quaff quaff marked this pull request as draft August 30, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants