jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1539581 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MongoConnection.java
Date Thu, 07 Nov 2013 10:09:57 GMT
Author: mreutegg
Date: Thu Nov  7 10:09:57 2013
New Revision: 1539581

URL: http://svn.apache.org/r1539581
Log:
OAK-1154: MongoMK throws exception when there are many listeners

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MongoConnection.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MongoConnection.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MongoConnection.java?rev=1539581&r1=1539580&r2=1539581&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MongoConnection.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/MongoConnection.java
Thu Nov  7 10:09:57 2013
@@ -18,6 +18,8 @@ package org.apache.jackrabbit.oak.plugin
 
 import com.mongodb.DB;
 import com.mongodb.Mongo;
+import com.mongodb.MongoOptions;
+import com.mongodb.ServerAddress;
 
 /**
  * The {@code MongoConnection} abstracts connection to the {@code MongoDB}.
@@ -36,7 +38,9 @@ public class MongoConnection {
      * @throws Exception If an error occurred while trying to connect.
      */
     public MongoConnection(String host, int port, String database) throws Exception {
-        mongo = new Mongo(host, port);
+        MongoOptions options = new MongoOptions();
+        options.setThreadsAllowedToBlockForConnectionMultiplier(100);
+        mongo = new Mongo(new ServerAddress(host, port), options);
         db = mongo.getDB(database);
     }
 



Mime
View raw message