directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1798448 - /directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Date Mon, 12 Jun 2017 12:36:45 GMT
Author: elecharny
Date: Mon Jun 12 12:36:44 2017
New Revision: 1798448

URL: http://svn.apache.org/viewvc?rev=1798448&view=rev
Log:
Applied patch for DIRSERVER-2007

Modified:
    directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java

Modified: directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java?rev=1798448&r1=1798447&r2=1798448&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
(original)
+++ directory/apacheds/branches/apacheds-value/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
Mon Jun 12 12:36:44 2017
@@ -91,6 +91,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.mina.core.session.IoSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -103,6 +105,9 @@ import org.apache.mina.core.session.IoSe
  */
 public class DefaultCoreSession implements CoreSession
 {
+    /** A logger for this class */
+    private static final Logger LOG = LoggerFactory.getLogger( DefaultCoreSession.class );
+
     /** The DirectoryService we are connected to */
     private final DirectoryService directoryService;
 
@@ -1392,7 +1397,19 @@ public class DefaultCoreSession implemen
         SortedEntrySerializer keySerializer = new SortedEntrySerializer();
         SortedEntrySerializer.setSchemaManager( schemaManager );
         
-        File file = File.createTempFile( "replica", ".sorted-data" );// see DIRSERVER-2007
+        File file = null;
+        
+        try 
+        {
+            file = File.createTempFile( "replica", ".sorted-data" );    // see DIRSERVER-2007
+        } 
+        catch ( IOException e ) 
+        {
+            // see DIRSERVER-2091
+            LOG.error("Error creating temp file in directory {} for sorting: {}",  System.getProperty(
"java.io.tmpdir" ),  e.getMessage(), e);
+            throw e;
+        }
+
         BaseRecordManager recMan = new BaseRecordManager( file.getAbsolutePath() );
 
         jdbm.btree.BTree<Entry, String> btree = new jdbm.btree.BTree<>( recMan,
comparator, keySerializer, NullStringSerializer.INSTANCE );



Mime
View raw message