Skip to content

Conversation

sksumit1
Copy link
Contributor

The max values should be set before setting core values.
Otherwise the core values will be compared with the default max values which is 8.
The stacktrace as below
Caused by: java.lang.IllegalArgumentException: Core connections for LOCAL hosts must be less than max (100 > 8)
at com.datastax.driver.core.PoolingOptions.checkConnectionsPerHostOrder(PoolingOptions.java:323)
at com.datastax.driver.core.PoolingOptions.setCoreConnectionsPerHost(PoolingOptions.java:203)
at org.springframework.cassandra.config.PoolingOptionsFactoryBean.afterPropertiesSet(PoolingOptionsFactoryBean.java:70)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550)
... 19 more
Also when modifying min & max simultaneous connections
Caused by: java.lang.IllegalArgumentException: Min simultaneous requests per connection for LOCAL hosts must be less than max (110 > 100)
at com.datastax.driver.core.PoolingOptions.checkRequestsPerConnectionOrder(PoolingOptions.java:317)
at com.datastax.driver.core.PoolingOptions.setMinSimultaneousRequestsPerConnectionThreshold(PoolingOptions.java:118)
at org.springframework.cassandra.config.PoolingOptionsFactoryBean.afterPropertiesSet(PoolingOptionsFactoryBean.java:62)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550)
... 19 more

The max values should be set before setting core values. Otherwise the core values will be compared with the default max values which is 8. The stacktrace as below Caused by: java.lang.IllegalArgumentException: Min simultaneous requests per connection for LOCAL hosts must be less than max (110 > 100)	at com.datastax.driver.core.PoolingOptions.checkRequestsPerConnectionOrder(PoolingOptions.java:317)	at com.datastax.driver.core.PoolingOptions.setMinSimultaneousRequestsPerConnectionThreshold(PoolingOptions.java:118)	at org.springframework.cassandra.config.PoolingOptionsFactoryBean.afterPropertiesSet(PoolingOptionsFactoryBean.java:62)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550)	... 19 more
@matthewadams
Copy link
Contributor

Hey, can you please add a test case to this pull request? Thanks!

@matthewadams
Copy link
Contributor

Oh yeah, and please add an issue at https://jira.spring.io/browse/DATACASS for it. We don't use the gihub issue tracker.

@sksumit1
Copy link
Contributor Author

sksumit1 commented Nov 1, 2014

Unit test added.
Jira bug : https://jira.spring.io/browse/DATACASS-176

prowave added a commit that referenced this pull request Jan 27, 2015
Fixing the bug in the file CassandraCqlClusterFactoryBean
@prowave prowave merged commit 41d68ac into spring-projects:master Jan 27, 2015
@prowave
Copy link
Contributor

prowave commented Jan 27, 2015

I will make the test a little more solid, but thank you for the fix.

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

Labels

None yet

3 participants