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

getGeneratedKeys() is not working after executeBatch() is called #358

Open
utenakr opened this issue Jun 23, 2017 · 3 comments
Open

getGeneratedKeys() is not working after executeBatch() is called #358

utenakr opened this issue Jun 23, 2017 · 3 comments
Labels
Enhancement An enhancement to the driver. Lower priority than bugs.
Projects

Comments

@utenakr
Copy link

utenakr commented Jun 23, 2017

I need support for getGeneratedKeys() on executeBatch() defined according to the JDBC spec. Our code is shared with other JDBC drivers, and we found our code is not working with MS-SQL Server JDBC.

I try to work around with replacing executeBatch() with executeUpdate(), but I am afraid this will lead to overhead to MS-SQL server. I need to implement getGeneratedKey() after executeBatch() is called with rollback compatibility.

If you have a workaround with my use case, that would be great!

Thank you,
Ji Sun

@v-nisidh
Copy link
Contributor

Thanks @utenakr for reporting this defect. I guess root cause of this is #245

Connect to #245

@utenakr
Copy link
Author

utenakr commented Jun 30, 2017

I see, thanks for pointing that out @v-nisidh Perhaps, would you let me know if you have a timeline for #245 feature? I would also need #245, too.

Appreciatively,

@v-nisidh v-nisidh added this to the Next Tasks milestone Jul 6, 2017
@xiangyushawn
Copy link
Contributor

xiangyushawn commented Nov 15, 2017

Hello @utenakr, it seems like the issue you created is different from #245. Did you get the following error?

The statement must be executed before any results can be obtained.

On JDBC specification it says

It is implementation-defined as to whether getGeneratedKeys will return generated values after invoking the executeBatch method.

This feature is optional and did not implemented in the driver.

I will confirm with our team and see when we can have a timeline for getGeneratedKeys after calling executeBatch method. Will keep you updated. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An enhancement to the driver. Lower priority than bugs.
Projects
MSSQL JDBC
  
Backlog
Development

No branches or pull requests

4 participants