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

PreparedStatements cannot be used in a loop #2

Open
GoogleCodeExporter opened this issue May 4, 2016 · 0 comments
Open

PreparedStatements cannot be used in a loop #2

GoogleCodeExporter opened this issue May 4, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Create a prepared statement like the following:
PreparedStatement prepStatement = conn.prepareStatement("set ? ?");


2. Use the prepStatement in a loop:

for(int i = 0; i < numberOfOperations; ++i) {
  prepStatement.setString(1, "jdbc-redis-key-prepared-" + i);
  prepStatement.setInt(2, i);
  prepStatement.execute();
}

3. check your redis-server with KEYS *

What is the expected output? What do you see instead?

This should have written *numberOfOperations* keys but it only writes one key.

What version of the product are you using? On what operating system?

I'm running on Ubuntu 9.09 and I'm using jdbc-redis_0.1-beta.jar


Please provide any additional information below.

I found out about this while writing some code to benchmark jdbc-redis. The
benchmark code can be found here: http://pastie.org/635885

Original issue reported on code.google.com by luc.cast...@gmail.com on 29 Sep 2009 at 10:47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant