Home:ALL Converter>Difference between PreparedStatements created from two different keyspaces

Difference between PreparedStatements created from two different keyspaces

Ask Time:2018-08-31T01:26:51         Author:Manish Karki

Json Formatter

I have multiple PreparedStatements which I create during bean initialization just once with current setup of single keyspace, but I'm now trying to work with multiple keyspaces while table schema remains the same as following:

//session1 is from connecting to keyspace1
//while session2 to keyspace2

PreparedStatements ps =  session1.prepare(sameStmt);
PreparesStatement ps1 = session2.prepare(sameStmt);

What I'm trying to figure out is, if there's difference between two besides being two different objects and from two different keyspaces considering the query string is same for both? The thing I want to achieve is to be able to create the PreparedStatement only once irrespective of keyspace if possible. Any suggestions?

Author:Manish Karki,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52102505/difference-between-preparedstatements-created-from-two-different-keyspaces
yy