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
olivergierke opened this Issue Feb 9, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@olivergierke

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 9, 2012

Member

Thanks for the bug report. Fixed in master.

Member

timowest commented Feb 9, 2012

Thanks for the bug report. Fixed in master.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 19, 2012

Member

released in 2.3.2

Member

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