Skip to content
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

Clarify the seed value of version #649

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

quaff
Copy link

@quaff quaff commented Aug 29, 2024

Supersede #600

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
Contributor

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
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
Contributor

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
Contributor

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
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
Contributor

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
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