Regarding mongoDB javascript functionality in kundera #212

Closed
sbheda opened this Issue Mar 14, 2013 · 4 comments

Projects

None yet

3 participants

@sbheda
sbheda commented Mar 14, 2013

How can i call MongoDB javascript file in kundera ?

@mevivs
Collaborator
mevivs commented Mar 14, 2013

2.4 release doesn't provide a handle for raw mongodb instance. It's in our roadmap and 2.5 release will enable this feature. Will post an update on this once it's checked-in current trunk branch.

-Vivek

@jmcollin78

Here is how I access to the MongoDB driver from Kundera:
Map<String, Client> clients = null;
MongoDBClient client = null;
clients = (Map<String, Client>) em.getDelegate();
if (clients != null) client = (MongoDBClient) clients.get(persistenceUnitName);
if (client != null) {
try {
Field db = client.getClass().getDeclaredField("mongoDb");
if (!db.isAccessible()) {
db.setAccessible(true);
}
mongoDB = (DB) db.get(client);
} catch(Exception e) {
log.error("Cannot access MongoDB driver. Cause : '{}'",e.getMessage());
throw new ExceptionTechnique(e);
}
}

Hope this helps

@sbheda
sbheda commented Mar 15, 2013

On 3/14/2013 7:50 PM, jmcollin92 wrote:

Here is how I access to the MongoDB driver from Kundera:
Map clients = null;
MongoDBClient client = null;
clients = (Map) em.getDelegate();
if (clients != null) client = (MongoDBClient)
clients.get(persistenceUnitName);
if (client != null) {
try {
Field db = client.getClass().getDeclaredField("mongoDb");
if (!db.isAccessible()) {
db.setAccessible(true);
}
mongoDB = (DB) db.get(client);
} catch(Exception e) {
log.error("Cannot access MongoDB driver. Cause : '{}'",e.getMessage());
throw new ExceptionTechnique(e);
}
}

Hope this helps


Reply to this email directly or view it on GitHub
#212 (comment).

Thank you very much. This help me a lot.

@mevivs
Collaborator
mevivs commented Apr 25, 2013

Please refer:
#248

for proper fix on this.

-Vivek

@mevivs mevivs closed this Aug 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment