Note that there are some explanatory texts on larger screens.

plurals
  1. PODataNucleus Mongodb - Dynamic parameter query is extremely slow
    primarykey
    data
    text
    <p>DataNucleus Mongodb when Dynamic parameter is set in the query, the query execution is extremely slow</p> <p>please find the code below</p> <pre><code>Extent userExtent = pm.getExtent(USERDATA.class, true); String filter = "param1 == paramvalue1 &amp;&amp; param2 == paramvalue2"; query = pm.newQuery(userExtent , filter); query.declareParameters("String param1 , String param2"); HashMap parameters = new HashMap(); parameters.put("paramvalue1", value1); parameters.put("paramvalue2",value2); result = (List)query.executeWithMap(parameters); </code></pre> <p>sometimes i am even getting below exception </p> <pre><code>com.mongodb.MongoException$CursorNotFound: cursor not found on server at com.mongodb.DBApiLayer$Result.init(DBApiLayer.java:371) at com.mongodb.DBApiLayer$Result._advance(DBApiLayer.java:418) at com.mongodb.DBApiLayer$Result.hasNext(DBApiLayer.java:400) at com.mongodb.DBCursor._hasNext(DBCursor.java:489) at com.mongodb.DBCursor.hasNext(DBCursor.java:509) at org.datanucleus.store.mongodb.MongoDBUtils.getObjectsOfCandidateType(MongoDBUtils.java:435) at org.datanucleus.store.mongodb.query.JDOQLQuery.performExecute(JDOQLQuery.java:340) at org.datanucleus.store.query.Query.executeQuery(Query.java:1789) at org.datanucleus.store.query.Query.executeWithArray(Query.java:1665) at org.datanucleus.store.query.Query.execute(Query.java:1638) at org.datanucleus.store.DefaultCandidateExtent.iterator(DefaultCandidateExtent.java:62) at org.datanucleus.store.mongodb.query.JDOQLQuery.performExecute(JDOQLQuery.java:262) at org.datanucleus.store.query.Query.executeQuery(Query.java:1789) at org.datanucleus.store.query.Query.executeWithMap(Query.java:1692) at org.datanucleus.api.jdo.JDOQuery.executeWithMap(JDOQuery.java:334) </code></pre> <p>Please help me to run this query fast as well as to avoid the above exception.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload