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

sql: Hibernate tries to load SERIAL types into an int #22607

Closed
awoods187 opened this issue Feb 12, 2018 · 2 comments
Closed

sql: Hibernate tries to load SERIAL types into an int #22607

awoods187 opened this issue Feb 12, 2018 · 2 comments
Assignees
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-semantics C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Milestone

Comments

@awoods187
Copy link
Contributor

Hibernate tries to load SERIAL types into an int, which fails if they are too large - testDirectIdPropertyAccess

We can likely use sequences to combat this but will need to investigate and test.

Referenced in 16491

@vilterp
Copy link
Contributor

vilterp commented Feb 12, 2018

Another solution is to make Hiberate use a java long, which is 64 bits, so it shouldn't fail to load a SERIAL value. Need to try & test that as well.

@vivekmenezes vivekmenezes modified the milestones: 2.0, 2.1 Mar 14, 2018
@knz knz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-semantics A-sql-pgcompat Semantic compatibility with PostgreSQL labels Apr 27, 2018
@knz
Copy link
Contributor

knz commented Jun 22, 2018

I think this may be a duplicate of #24062.

@knz knz changed the title Hibernate tries to load SERIAL types into an int sql: Hibernate tries to load SERIAL types into an int Jul 23, 2018
craig bot pushed a commit that referenced this issue Aug 16, 2018
28575: sql: introduce virtual sequences and use with SERIAL r=knz a=knz

Very good idea by @BramGruneir 

New features: virtual sequences (opt-in) and create-sequence-upon-SERIAL (opt-in). See individual commits for details and release notes.

For reference:

- I made everything opt-in here (i.e. default to previous CockroachDB behavior) to minimize risk.
- UX with Hibernate will thus not automatically be improved. We need to inform users (and upgrade our tutorials/docs) that this experimental feature is available and how to use it to unblock problems.
- It is possible that making the new default be `virtual_sequence` will both be backward-compatible with performance and unlock UX for Hibernate users. This has @awoods187 preference I think. However I propose to only flip that switch after we've seen a week or two pass with this patch merged.

Fixes #22607 (using the new setting set to `sql_sequence`).
Fixes #24062 (using the new setting set to `sql_sequence`).
Fixes #26730 (using the new setting set to either `virtual_sequence` or `sql_sequence`).



Co-authored-by: Raphael 'kena' Poss <[email protected]>
@craig craig bot closed this as completed in #28575 Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-semantics C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

4 participants