{"action":"created","issue":{"url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/issues/30","labels_url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/issues/30/comments","events_url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/issues/30/events","html_url":"https://github.com/davidmoten/rxjava-jdbc/pull/30","id":87048671,"number":30,"title":"[WIP] Execute Update Query as Batch Update","user":{"login":"EmteZogaf","id":1272656,"avatar_url":"https://avatars.githubusercontent.com/u/1272656?v=3","gravatar_id":"","url":"https://api.github.com/users/EmteZogaf","html_url":"https://github.com/EmteZogaf","followers_url":"https://api.github.com/users/EmteZogaf/followers","following_url":"https://api.github.com/users/EmteZogaf/following{/other_user}","gists_url":"https://api.github.com/users/EmteZogaf/gists{/gist_id}","starred_url":"https://api.github.com/users/EmteZogaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EmteZogaf/subscriptions","organizations_url":"https://api.github.com/users/EmteZogaf/orgs","repos_url":"https://api.github.com/users/EmteZogaf/repos","events_url":"https://api.github.com/users/EmteZogaf/events{/privacy}","received_events_url":"https://api.github.com/users/EmteZogaf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-10T17:41:32Z","updated_at":"2015-06-12T10:31:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/pulls/30","html_url":"https://github.com/davidmoten/rxjava-jdbc/pull/30","diff_url":"https://github.com/davidmoten/rxjava-jdbc/pull/30.diff","patch_url":"https://github.com/davidmoten/rxjava-jdbc/pull/30.patch"},"body":"A simple approach to execute batch updates. I needed this for a work project executing ~800M insert queries per run. Hope this functionality will be added this way or another as I really like avoiding java.sql.*.\r\n\r\nI marked it as \"work in progress\" because it lacks test cases and documentation and probably needs some code refactoring."},"comment":{"url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/issues/comments/111442361","html_url":"https://github.com/davidmoten/rxjava-jdbc/pull/30#issuecomment-111442361","issue_url":"https://api.github.com/repos/davidmoten/rxjava-jdbc/issues/30","id":111442361,"user":{"login":"EmteZogaf","id":1272656,"avatar_url":"https://avatars.githubusercontent.com/u/1272656?v=3","gravatar_id":"","url":"https://api.github.com/users/EmteZogaf","html_url":"https://github.com/EmteZogaf","followers_url":"https://api.github.com/users/EmteZogaf/followers","following_url":"https://api.github.com/users/EmteZogaf/following{/other_user}","gists_url":"https://api.github.com/users/EmteZogaf/gists{/gist_id}","starred_url":"https://api.github.com/users/EmteZogaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EmteZogaf/subscriptions","organizations_url":"https://api.github.com/users/EmteZogaf/orgs","repos_url":"https://api.github.com/users/EmteZogaf/repos","events_url":"https://api.github.com/users/EmteZogaf/events{/privacy}","received_events_url":"https://api.github.com/users/EmteZogaf/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T10:31:34Z","updated_at":"2015-06-12T10:31:34Z","body":"I don't like the `List<List<Parameter>>` either. But I don't see which subscriber should keep the counter. Right now `QueryUpdateOnSubscribe` is created for each parameter group, gets a connection, creates the `PreparedStatement`, executes the query with the given parameter group and pushes a new Observable with the update count which is flattened with the other results if there are more than one parameter group.\r\n\r\nIn order to add `batchSize` parameter groups both the `PreparedStatement` and the connection need to stay open till the batch can be executed. This can be problematic if it's the only available connection. So I think it's better to buffer the parameter groups and only occupy a connection for the shortest time possible. But maybe I miss something."}}