Description
A statement was reused accross query execution without being prepared.
That lead to possibly this kind of error:
Exception calling IsOverQuota: Invalid amount of bind variables com.datastax.driver.core.exceptions.InvalidQueryException: Invalid amount of bind variables at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50) at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:68) at org.apache.james.mailbox.cassandra.quota.CassandraPerUserMaxQuotaManager.getDefaultMaxMessage(CassandraPerUserMaxQuotaManager.java:113) at org.apache.james.mailbox.cassandra.quota.CassandraPerUserMaxQuotaManager.getMaxMessage(CassandraPerUserMaxQuotaManager.java:133) at org.apache.james.mailbox.store.quota.StoreQuotaManager.getMessageQuota(StoreQuotaManager.java:52) at org.apache.james.transport.matchers.IsOverQuota.match(IsOverQuota.java:83) at org.apache.james.mailetcontainer.impl.camel.MatcherSplitter.split(MatcherSplitter.java:112) at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
We should rather use a prepared statement and keeping the key as a bind variable.