Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 61668 invoked from network); 12 Jun 2002 13:55:09 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jun 2002 13:55:09 -0000 Received: (qmail 7546 invoked by uid 97); 12 Jun 2002 13:55:11 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@jakarta.apache.org Received: (qmail 7504 invoked by uid 97); 12 Jun 2002 13:55:10 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 7492 invoked by uid 98); 12 Jun 2002 13:55:09 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: From: "Friedman, Eric" To: "'Stefan Bergstrand '" , "'Lucene Developer '" Subject: RE: Locking problems Date: Wed, 12 Jun 2002 07:03:10 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) List-Subscribe: Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Stefan, your locksDisabled() method is a reimplementation of functionality already provided by the Java SDK: Boolean.getBoolean(String name) does exactly what your method does: Returns true if and only if the system property named by the argument exists and is equal to the string "true". -----Original Message----- From: Stefan Bergstrand To: Lucene Developer Sent: 6/12/02 3:28 AM Subject: Re: Locking problems Ok, now I have fixed a way to turn locking off. Here is the modified method in FSDirectory, and a helper method. Locking is turned off by setting -DdisableLuceneLocks=true on the command line. Thanks to Matt Tucker for pointing out the place where to modify. /Stefan B /** Construct a {@link Lock}. * @param name the name of the lock file */ public final Lock makeLock(String name) { final File lockFile = new File(directory, name); return new Lock() { public boolean obtain() throws IOException { if (locksDisabled()){ return true; } if (Constants.JAVA_1_1) return true; // locks disabled in jdk 1.1 return lockFile.createNewFile(); } public void release() { if (locksDisabled()){ return; } if (Constants.JAVA_1_1) return; // locks disabled in jdk 1.1 lockFile.delete(); } public String toString() { return "Lock@" + lockFile; } }; } protected final boolean locksDisabled(){ if (System.getProperty("disableLuceneLocks") == null){ return false; } else { return System.getProperty("disableLuceneLocks").equals("true"); } } -- --------------------------- Stefan Bergstrand Polopoly - Cultivating the information garden Kungsgatan 88, SE-112 27 Stockholm, SWEDEN Ph: +46 8 506 782 67 Cell: +46 704 47 82 67 stefan.bergstrand@polopoly.com, http://www.polopoly.com -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: