Return-Path: Delivered-To: apmail-jakarta-slide-dev-archive@www.apache.org Received: (qmail 86017 invoked from network); 1 Dec 2005 07:20:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Dec 2005 07:20:31 -0000 Received: (qmail 97975 invoked by uid 500); 1 Dec 2005 07:20:30 -0000 Delivered-To: apmail-jakarta-slide-dev-archive@jakarta.apache.org Received: (qmail 97696 invoked by uid 500); 1 Dec 2005 07:20:28 -0000 Mailing-List: contact slide-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Slide Developers Mailing List" Reply-To: "Slide Developers Mailing List" Delivered-To: mailing list slide-dev@jakarta.apache.org Received: (qmail 97685 invoked by uid 99); 1 Dec 2005 07:20:28 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2005 23:20:26 -0800 Received: by ajax.apache.org (Postfix, from userid 99) id 4AD69CB; Thu, 1 Dec 2005 08:20:04 +0100 (CET) From: bugzilla@apache.org To: slide-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 37732] New: - Resource Locks Aren't Persisted Using LDAP X-Bugzilla-Reason: AssignedTo Message-Id: <20051201072004.4AD69CB@ajax.apache.org> Date: Thu, 1 Dec 2005 08:20:04 +0100 (CET) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37732 Summary: Resource Locks Aren't Persisted Using LDAP Product: Slide Version: Nightly Platform: PC OS/Version: Windows 2000 Status: NEW Severity: normal Priority: P2 Component: Stores AssignedTo: slide-dev@jakarta.apache.org ReportedBy: damien.bastin@suncorp.com.au Locks on resources are lost when you restart the WebDAV server if you dont store user info in the database. The lock table is not being written to by when using LDAP for user information. This is because the insert command in the StandardRBDMSAdapter checks for users in the slide database. When you are using an external source for users and roles (i.e. LDAP) there is nothing stored in the database except for what is defined in the Domain.xml. This problem may effect other parts of the system including LINKS, LABELs and potentially ACLs. To reproduce the problem: * Log into WebDAV as a user in LDAP store. * Use a WebDAV client to lock a resource. * Restart WebDAV server. * Refresh the view, the resource will be unlocked. To fix the problem: * Insert /users/support into the WebDAV URI table. * Log into WebDAV. * Use a WebDAV client to lock a resource. * Restart WebDAV server. * Refresh the view, the resource will be locked. Here is the solution in code. You can change the StandardRDBMSAdapter like so: public void putLock(Connection connection, Uri uri, NodeLock lock) throws ServiceAccessException { PreparedStatement statement = null; try { int inheritable = lock.isInheritable() ? 1 : 0; int exclusive = lock.isExclusive() ? 1 : 0; long lockid = assureUriId(connection, lock.getLockId()); populateUriTableWithUserUri(connection, lock); statement = connection.prepareStatement( "insert into LOCKS (LOCK_ID,OBJECT_ID,SUBJECT_ID,TYPE_ID,EXPIRATION_DATE,IS_INHERITABLE,IS_EXCLUSIVE,OWNER) " + "select ?, object.URI_ID, subject.URI_ID, type.URI_ID, ?, ?, ?, ? " + "from URI object, URI subject, URI type WHERE object.URI_STRING=? and subject.URI_STRING=? and type.URI_STRING=?"); statement.setLong(1, lockid); statement.setLong(2, lock.getExpirationDate().getTime()); statement.setInt(3, inheritable); statement.setInt(4, exclusive); statement.setString(5, lock.getOwnerInfo()); statement.setString(6, lock.getObjectUri()); statement.setString(7, lock.getSubjectUri()); statement.setString(8, lock.getTypeUri()); statement.execute(); if (statement.getUpdateCount() == 0) { throw new ServiceAccessException(service, "Insert of the lock failed as the user could not be found in the URI table."); } } catch (SQLException e) { throw createException(e, uri.toString()); } finally { close(statement); } } private void populateUriTableWithUserUri(Connection connection, NodeLock lock) throws SQLException { PreparedStatement statement = connection.prepareStatement("select URI_ID from URI where URI_STRING = ?"); statement.setString(1, lock.getSubjectUri()); statement.execute(); ResultSet results = statement.getResultSet(); boolean hasNextRow = results.next(); if (hasNextRow == false) { insertUri(connection, lock.getSubjectUri()); } } private void insertUri(Connection connection, String subjectUri) throws SQLException { PreparedStatement statement = connection.prepareStatement("Insert into URI (URI_STRING) values (?)"); statement.setString(1, subjectUri); statement.execute(); } END OF DOCUMENTATION -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: slide-dev-help@jakarta.apache.org