Closed sohelmk closed 6 years ago
Hi @sohelmk,
You should be able to query any data of Cassandra (not only inserted by Kundera).
Are you using schema generation property in persistence.xml
?
Please share your persistence.xml
file.
Thanks Devender for your response. We found the root cause: It was use of schema-gen feature along with "keySpaceDeletion" flag in embedded Cassandra. It was causing all keyspaces to be recreated.
Kudos to Kundera!
Regards, Sohel
Hi, We are using kundera to persist data. During unit test we find that any data inserted using direct CQL is not available to Kundera and vice versa. We tried flush etc on kundera session, but no luck. Any data inserted in kundera can be queried back using kundera. Any data inserted using CQL can be queries back using CQL
I am pasting relevant scala code that shows the two approaches
KUNDERA CODE (used to insert group objects and it works)
def create(group: Group): Either[String, String] = { try { val em = emf.createEntityManager() em.persist(group)
}
CQL CODE (used to query the group table in which rows are inserted by above) EmbeddedCassandraServerHelper.startEmbeddedCassandra("embeddedCassandra.yaml"); //yaml file attached session = EmbeddedCassandraServerHelper.getSession resultSet = session.execute("SELECT * from group "); if (resultSet.isExhausted())
println("No data in group"); else println(resultSet.all().toString())
Note we are new to Cassandra, any help would be greatly appreciated.
Thanks, Sohel