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 - Accessing generated keys fails for Oracle #97

Closed
odrotbohm opened this issue Feb 9, 2012 · 2 comments
Closed

SQL - Accessing generated keys fails for Oracle #97

odrotbohm opened this issue Feb 9, 2012 · 2 comments

Comments

@odrotbohm
Copy link

@odrotbohm odrotbohm commented Feb 9, 2012

SQLInsertClause.prepareStatementAndParameters(…) uses connection.prepareStatement(String sql, int flag) to pipe in a constant trying to trigger the underlying database to return auto-generated key. However with recent Oracle drivers ojdbc14, ojdbc5, ojdbc6 this causes a ROWID to be returned in the key ResultSet which in turn cannot be accessed with rs.getBigDecimal(…) or the like (we get a driver exception claiming that getBigDecimal(…) is not implemented for T4CRowIdAccessor)

We were trying to use Spring JDBC to reproduce the issue and used connection.prepareStatement(String sql, String[] keyColumns) which then correctly returned the generated key in the format expected (BigDecimal in our case). I don't know in how far a change to use this method for statement setup might affect other databases.

@timowest
Copy link
Member

@timowest timowest commented Feb 9, 2012

Thanks for the bug report. Fixed in master.

@timowest
Copy link
Member

@timowest timowest commented Feb 19, 2012

released in 2.3.2

@timowest timowest closed this Feb 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants