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

SybaseMaxValueIncrementer doesn't work with non-enterprise Sybase db [SPR-7623] #12279

Closed
spring-projects-issues opened this issue Oct 7, 2010 · 6 comments
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Tarald Saxi Stormark opened SPR-7623 and commented

In SybaseMaxValueIncrementer the code line: stmt.executeUpdate("insert into " + getIncrementerName() + " values()"); yields SQLException. It should be stmt.executeUpdate("insert into " + getIncrementerName() + " values(DEFAULT)"); instead.

See attached patch. This goes for all versions of SybaseMaxValueIncrementer.


Affects: 2.5.5

Referenced from: commits bd22bed

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Thomas, does this change look ok to you? Any backwards compatility issues here?

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Thomas Risberg commented

I don't see a patch attached. Using the currently recommended table definition I tried executing:

insert into tab_sequence values(DEFAULT)

This throws an exception with Adaptive Server Enterprise/15.0.2.

[Error Code: 7743, SQL State: ZZZZZ] An explicit value for the identity field in table 'tab_sequence' can only be specified in an insert statement when a field list is used.

So we would need a bit more background for when the current implementation fails (what database and version) so we can find an appropriate solution.

Thomas

@spring-projects-issues
Copy link
Collaborator Author

Tarald Saxi Stormark commented

I'll talk to our DB guy at work on monday and get all the details.

What I know is that we are not using the Adaptive Server Enterprise, we are using the cheaper version for small and medium size businesses and it's using SQL Anywhere. It does not accept inserts without arguments, so I had to copy the class and insert the keyword 'DEFAULT' as described and it worked. But now it seems Adaptive Server Enterprise doesn't accept the keyword 'DEFAULT' so this will probably not be the solution.

@spring-projects-issues
Copy link
Collaborator Author

Tarald Saxi Stormark commented

This is our DB:
SQL Anywhere Network Server Version 11.0.0.1511

@spring-projects-issues
Copy link
Collaborator Author

Thomas Risberg commented

Thanks for the feedback, I've downloaded Sybase Anywhere 11.0.1 so I can do some testing.

I'm planning on adding a new SybaseAnywhereMaxValueIncrementer that uses the syntax that works for SQL Anywhere - should be able to do that for 3.0.5.

-Thomas

@spring-projects-issues
Copy link
Collaborator Author

Tarald Saxi Stormark commented

Thanks for fixing it so soon :-)

@spring-projects-issues spring-projects-issues added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.5 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant