{"action":"closed","issue":{"url":"https://api.github.com/repos/SpringData/spring-data-cassandra/issues/27","labels_url":"https://api.github.com/repos/SpringData/spring-data-cassandra/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/SpringData/spring-data-cassandra/issues/27/comments","events_url":"https://api.github.com/repos/SpringData/spring-data-cassandra/issues/27/events","html_url":"https://github.com/SpringData/spring-data-cassandra/issues/27","id":115429967,"number":27,"title":"spring data cassandra batch inserts/updates/deletes issues","user":{"login":"Rambabu-Kokkiligadda","id":15682216,"avatar_url":"https://avatars.githubusercontent.com/u/15682216?v=3","gravatar_id":"","url":"https://api.github.com/users/Rambabu-Kokkiligadda","html_url":"https://github.com/Rambabu-Kokkiligadda","followers_url":"https://api.github.com/users/Rambabu-Kokkiligadda/followers","following_url":"https://api.github.com/users/Rambabu-Kokkiligadda/following{/other_user}","gists_url":"https://api.github.com/users/Rambabu-Kokkiligadda/gists{/gist_id}","starred_url":"https://api.github.com/users/Rambabu-Kokkiligadda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rambabu-Kokkiligadda/subscriptions","organizations_url":"https://api.github.com/users/Rambabu-Kokkiligadda/orgs","repos_url":"https://api.github.com/users/Rambabu-Kokkiligadda/repos","events_url":"https://api.github.com/users/Rambabu-Kokkiligadda/events{/privacy}","received_events_url":"https://api.github.com/users/Rambabu-Kokkiligadda/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-06T04:04:06Z","updated_at":"2015-11-06T04:05:14Z","closed_at":"2015-11-06T04:05:14Z","body":"Hi,\r\n\r\nGreetings for the day.\r\n\r\nI am using spring data Cassandra maven dependency as shown below:\r\n\r\n<dependency>\r\n   <groupId>org.springframework.data</groupId>\r\n   <artifactId>spring-data-cassandra</artifactId>\r\n   <version>1.2.0.RELEASE</version>\r\n</dependency> \r\n\r\nIn few cases, I want to update the few column values for multiple POJO objects. In this case I am using cassandra operations batch update.\r\n\r\ncassandraops.update(List<T>)\r\n\r\nIn few cases, I want to delete the existing stuff and need to add latest POJO objects. We may found same primary keys for few rows in this case. In this case, I am using cassandra operations batch delete and insert one by one.\r\n\r\ncassandraops.delete(List<T>)\r\ncassandraops.insert(List<T>)\r\n\r\nThis operations is failing most of the times. Failed to update database properly. Some times few will get updated/deleted/inserted. Its very strange and unknown issue.\r\n\r\nWe are blocked due to this. Immediate help is much appreciated.\r\n\r\n@Autowired\r\nprivate CassandraOperations cassandraOperations;\r\n\r\nFew code snippets are copied below: \r\n\r\nimport org.springframework.cassandra.config.CassandraCqlClusterFactoryBean;\r\nimport org.springframework.context.annotation.Configuration;\r\nimport org.springframework.context.annotation.PropertySource;\r\nimport org.springframework.core.env.Environment;\r\nimport org.springframework.data.cassandra.config.java.AbstractCassandraConfiguration;\r\nimport org.springframework.data.cassandra.repository.config.EnableCassandraRepositories;\r\n\r\n@Configuration\r\n@EnableCassandraRepositories(\"com.eiq\")\r\n@PropertySource(value = {\r\n        \"file:${catalina.base}/webapps/socvueportal/resources/cassandra.properties\" })\r\npublic class CassandraConfig extends AbstractCassandraConfiguration\r\n{\r\n\t@Autowired\r\n\tprivate Environment environment;\r\n\r\n\t@Override\r\n\tprotected String getKeyspaceName()\r\n\t{\r\n\t\treturn environment.getProperty(\"keyspace\");\r\n\t}\r\n\r\n\t@Override\r\n\tpublic CassandraCqlClusterFactoryBean cluster()\r\n\t{\r\n\t\tCassandraCqlClusterFactoryBean cluster = super.cluster();\r\n\t\tcluster.setContactPoints(environment.getProperty(\"contactPoints\"));\r\n\t\tcluster.setPort(Integer.valueOf(environment.getProperty(\"port\")));\r\n\r\n\t\treturn cluster;\r\n\t}\r\n}\r\n\r\n....\r\n\r\nif (!lstIncidents.isEmpty())\r\n\tcassandraOperations.update(lstIncidents);\r\nif (!lstTasks.isEmpty())\r\n\tcassandraOperations.update(lstTasks);\r\nif (!lstTaskHistory.isEmpty())\r\n\tcassandraOperations.insert(lstTaskHistory);"}}