Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Cassandra] Re-preparing already prepared query warning
PostPosted: Mon Nov 21, 2016 2:40 pm 
Newbie

Joined: Mon Nov 21, 2016 2:30 pm
Posts: 1
While using Cassandra dialect, because of preparing query statement multiple times, there are warnings like that
Quote:
Re-preparing already prepared query ... Please note that preparing the same query more than once is generally an anti-pattern and will likely affect performance. Consider preparing the statement only once.


As far as I seen from the code in the `Cassandra Dialect`, statement is prepared two times:
- While loading from cache loader into prepared statement cache https://github.com/hibernate/hibernate-ogm/blob/master/cassandra/src/main/java/org/hibernate/ogm/datastore/cassandra/CassandraDialect.java#L108
- After retrieving from cache https://github.com/hibernate/hibernate-ogm/blob/master/cassandra/src/main/java/org/hibernate/ogm/datastore/cassandra/CassandraDialect.java#L126

I think, the second one (preparing query statement after retrieving from cache) is redundant, isn't it?

Regards.


Top
 Profile  
 
 Post subject: Re: [Cassandra] Re-preparing already prepared query warning
PostPosted: Tue Nov 22, 2016 6:25 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 287
Thanks for the feedback,
I'll have a look


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.