protected Session getReadSession ( ) throws CpoException { Session session ; try { if ( ! ( invalidReadSession ) ) { session = getReadDataSource ( ) . getSession ( ) ; } else { session = getWriteDataSource ( ) . getSession ( ) ; } } catch ( Exception e ) { invalidReadSession = true ; String msg = "getReadConnection(): failed" ; logger . error ( msg , e ) ; session = getWriteSession ( ) ; } return session ; }
getReadSession returns the read session for Cassandra