I wanted to integrate the EmbeddedCassandraServer with a migration tool, however this migration management tool would close the sessions that is was provided with. As far as I could see, there are now way to re-establish a connection that was closed inside this project.
This simple fix allow us to call re-create a valid session after the migration by calling getSession (which would trigger a new initSession). This is however not the perfect fix because a lot of private methods access the session field directly and would still try to used a closed session if the second call to initSession is made.
It also seems that some abstract classes such as AbstractCassandraUnit4CQLTestCase are storing the first session they receive and would not benefit from an updated call to getSession in the underlying CassandraCQLUnit object.
I wanted to integrate the EmbeddedCassandraServer with a migration tool, however this migration management tool would close the sessions that is was provided with. As far as I could see, there are now way to re-establish a connection that was closed inside this project.
This simple fix allow us to call re-create a valid session after the migration by calling
getSession
(which would trigger a newinitSession
). This is however not the perfect fix because a lot of private methods access thesession
field directly and would still try to used a closed session if the second call toinitSession
is made.It also seems that some abstract classes such as
AbstractCassandraUnit4CQLTestCase
are storing the first session they receive and would not benefit from an updated call togetSession
in the underlyingCassandraCQLUnit
object.What do you think ?