You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2017/09/16 08:27:31 UTC

svn commit: r1808517 [1/2] - in /openoffice/trunk/main: connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/ connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/ connectivity/java/sdbc_postgresql/src...

Author: damjan
Date: Sat Sep 16 08:27:31 2017
New Revision: 1808517

URL: http://svn.apache.org/viewvc?rev=1808517&view=rev
Log:
Locking and disposal cleanup.

Firstly, add isDisposed() and checkDisposed() methods to
main/javaunohelper's com.sun.star.lib.uno.helper.ComponentBase, so that
Java components can easily test and assert their disposal state. Comment
these for a clearer understanding of how disposal works, namely that
locking against disposal must cover all access of that component, so that
the component can't be disposed half-way through being used. These methods
are stricter than before, where only bDisposed was checked, which allowed
the component to be used during disposal (as postDisposing() runs before
bDisposed is set)!!

Fix and simplify locking in the PostgreSQL driver, first by using the new
methods in ComponentBase instead of tracking disposal separately with our
own variable, then expand locking to entire methods so components can't be
disposed during a method's execution, and finally eliminate disposal
tracking in components that purely wrap another component and modify
data in transit, as all disposal management is done by the wrapped
component and we don't have to worry as long as our postDispose() has
nothing special to do and just delegates to the wrapped component.

Also eliminate internal locks in objects, and use "this" as the lock for
the non-container objects like Table / Column / Key, while using the
parent's "this" as the lock for contain objects like Tables, Columns, Keys
etc., as this further simplifies locking, allow using method-level locking
instead of "synchronized (this)", reduces the number of fields, simplifies
locking in subclasses, and theoretically allows callers to hold the lock
across multiple method invocations.

Other minor fixes, some exception cleanup, use of AtomicInteger to generate
numbers in PropertySetAdapter, etc.

Patch by: me


Modified:
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySetAdapter.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OCatalog.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/ODescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OTable.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DatabaseMetaDataResultSet.java
    openoffice/trunk/main/javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java Sat Sep 16 08:27:31 2017
@@ -52,13 +52,12 @@ public class PostgresqlCatalog extends O
                 System.out.println("Table " + name);
                 names.add(name);
             }
-            return new PostgresqlTables(lock, metadata, this, names);
-        } catch (ElementExistException elementExistException) {
-        } catch (SQLException sqlException) {
+            return new PostgresqlTables(this, metadata, this, names);
+        } catch (ElementExistException | SQLException exception) {
+            throw new com.sun.star.uno.RuntimeException("Error", exception);
         } finally {
             CompHelper.disposeComponent(results);
         }
-        return null;
     }
     
     @Override
@@ -72,13 +71,12 @@ public class PostgresqlCatalog extends O
                 String name = buildName(row);
                 names.add(name);
             }
-            return new PostgresqlTables(lock, metadata, this, names);
-        } catch (ElementExistException elementExistException) {
-        } catch (SQLException sqlException) {
+            return new PostgresqlTables(this, metadata, this, names);
+        } catch (ElementExistException | SQLException exception) {
+            throw new com.sun.star.uno.RuntimeException("Error", exception);
         } finally {
             CompHelper.disposeComponent(results);
         }
-        return null;
     }
     
     @Override

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java Sat Sep 16 08:27:31 2017
@@ -22,7 +22,6 @@
 package com.sun.star.sdbcx.comp.postgresql;
 
 import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.sun.star.container.XNameAccess;
 import com.sun.star.lang.DisposedException;
@@ -43,7 +42,6 @@ public class PostgresqlConnection extend
     private XComponent implComponent;
     private XWarningsSupplier implWarningsSupplier;
     private String url;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
     private HashSet<XComponent> statements = new HashSet<>();
     
     public PostgresqlConnection(XConnection impl, String url) {
@@ -57,7 +55,6 @@ public class PostgresqlConnection extend
     
     @Override
     protected synchronized void postDisposing() {
-        isDisposed.set(true);
         implComponent.dispose();
         for (XComponent pgStatement : statements) {
             try {
@@ -67,12 +64,6 @@ public class PostgresqlConnection extend
         }
     };
     
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XEventListener:
     
     public synchronized void disposing(EventObject source) {
@@ -81,12 +72,12 @@ public class PostgresqlConnection extend
     
     // XWarningsSupplier:
     
-    public void clearWarnings() throws SQLException {
+    public synchronized void clearWarnings() throws SQLException {
         checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
     
-    public Object getWarnings() throws SQLException {
+    public synchronized Object getWarnings() throws SQLException {
         checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
@@ -97,7 +88,7 @@ public class PostgresqlConnection extend
         dispose();
     }
     
-    public void commit() throws SQLException {
+    public synchronized void commit() throws SQLException {
         checkDisposed();
         impl.commit();
     }
@@ -110,42 +101,42 @@ public class PostgresqlConnection extend
         return pgStatement;
     }
     
-    public boolean getAutoCommit() throws SQLException {
+    public synchronized boolean getAutoCommit() throws SQLException {
         checkDisposed();
         return impl.getAutoCommit();
     }
     
-    public String getCatalog() throws SQLException {
+    public synchronized String getCatalog() throws SQLException {
         checkDisposed();
         return impl.getCatalog();
     }
     
-    public XDatabaseMetaData getMetaData() throws SQLException {
+    public synchronized XDatabaseMetaData getMetaData() throws SQLException {
         checkDisposed();
         return new PostgresqlDatabaseMetadata(impl.getMetaData(), this, url);
     }
     
-    public int getTransactionIsolation() throws SQLException {
+    public synchronized int getTransactionIsolation() throws SQLException {
         checkDisposed();
         return impl.getTransactionIsolation();
     }
     
-    public XNameAccess getTypeMap() throws SQLException {
+    public synchronized XNameAccess getTypeMap() throws SQLException {
         checkDisposed();
         return impl.getTypeMap();
     }
     
-    public boolean isClosed() throws SQLException {
+    public synchronized boolean isClosed() throws SQLException {
         checkDisposed();
         return impl.isClosed();
     }
     
-    public boolean isReadOnly() throws SQLException {
+    public synchronized boolean isReadOnly() throws SQLException {
         checkDisposed();
         return impl.isReadOnly();
     }
     
-    public String nativeSQL(String arg0) throws SQLException {
+    public synchronized String nativeSQL(String arg0) throws SQLException {
         checkDisposed();
         return impl.nativeSQL(arg0);
     }
@@ -166,32 +157,32 @@ public class PostgresqlConnection extend
         return pgStatement;
     }
     
-    public void rollback() throws SQLException {
+    public synchronized void rollback() throws SQLException {
         checkDisposed();
         impl.rollback();
     }
     
-    public void setAutoCommit(boolean arg0) throws SQLException {
+    public synchronized void setAutoCommit(boolean arg0) throws SQLException {
         checkDisposed();
         impl.setAutoCommit(arg0);
     }
     
-    public void setCatalog(String arg0) throws SQLException {
+    public synchronized void setCatalog(String arg0) throws SQLException {
         checkDisposed();
         impl.setCatalog(arg0);
     }
     
-    public void setReadOnly(boolean arg0) throws SQLException {
+    public synchronized void setReadOnly(boolean arg0) throws SQLException {
         checkDisposed();
         impl.setReadOnly(arg0);
     }
     
-    public void setTransactionIsolation(int arg0) throws SQLException {
+    public synchronized void setTransactionIsolation(int arg0) throws SQLException {
         checkDisposed();
         impl.setTransactionIsolation(arg0);
     }
     
-    public void setTypeMap(XNameAccess arg0) throws SQLException {
+    public synchronized void setTypeMap(XNameAccess arg0) throws SQLException {
         checkDisposed();
         impl.setTypeMap(arg0);
     }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java Sat Sep 16 08:27:31 2017
@@ -22,10 +22,8 @@
 package com.sun.star.sdbcx.comp.postgresql;
 
 import java.util.ArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.sun.star.beans.PropertyValue;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.XServiceInfo;
 import com.sun.star.lang.XSingleComponentFactory;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -37,6 +35,7 @@ import com.sun.star.sdbc.XDriver;
 import com.sun.star.sdbc.XDriverManager;
 import com.sun.star.sdbcx.XDataDefinitionSupplier;
 import com.sun.star.sdbcx.XTablesSupplier;
+import com.sun.star.sdbcx.comp.postgresql.util.Resources;
 import com.sun.star.sdbcx.comp.postgresql.util.SharedResources;
 import com.sun.star.sdbcx.comp.postgresql.util.StandardSQLState;
 import com.sun.star.uno.Exception;
@@ -49,7 +48,6 @@ public class PostgresqlDriver extends Co
             "com.sun.star.sdbcx.Driver"
     };
     private XComponentContext componentContext;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
     
     public static XSingleComponentFactory __getComponentFactory(String implName) {
         XSingleComponentFactory xSingleComponentFactory = null;
@@ -72,18 +70,11 @@ public class PostgresqlDriver extends Co
     // XComponent:
     
     @Override
-    protected void postDisposing() {
-        isDisposed.set(true);
+    protected synchronized void postDisposing() {
         componentContext = null;
         SharedResources.revokeClient();
     }
     
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-    
     // XServiceInfo:
     
     @Override
@@ -114,7 +105,7 @@ public class PostgresqlDriver extends Co
     }
     
     @Override
-    public XConnection connect(String url, PropertyValue[] info) throws SQLException {
+    public synchronized XConnection connect(String url, PropertyValue[] info) throws SQLException {
         checkDisposed();
         XConnection connection = null;
         if (acceptsURL(url)) {
@@ -184,15 +175,16 @@ public class PostgresqlDriver extends Co
     
     // XDataDefinitionSupplier:
     
-    public XTablesSupplier getDataDefinitionByConnection(XConnection connection) throws SQLException {
+    public synchronized XTablesSupplier getDataDefinitionByConnection(XConnection connection) throws SQLException {
         checkDisposed();
         return new PostgresqlCatalog((PostgresqlConnection)connection);
     }
     
-    public XTablesSupplier getDataDefinitionByURL(String url, PropertyValue[] info) throws SQLException {
+    public synchronized XTablesSupplier getDataDefinitionByURL(String url, PropertyValue[] info) throws SQLException {
         checkDisposed();
         if (!acceptsURL(url)) {
-            throw new SQLException(); // FIXME
+            String error = SharedResources.getInstance().getResourceString(Resources.STR_URI_SYNTAX_ERROR);
+            throw new SQLException(error, this, StandardSQLState.SQL_UNABLE_TO_CONNECT.text(), 0, null);
         }
         return getDataDefinitionByConnection(connect(url, info));
     }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java Sat Sep 16 08:27:31 2017
@@ -21,8 +21,6 @@
 
 package com.sun.star.sdbcx.comp.postgresql;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
@@ -30,7 +28,6 @@ import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
 import com.sun.star.io.XInputStream;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -69,7 +66,6 @@ public class PostgresqlPreparedStatement
     private XWarningsSupplier implWarningsSupplier;
     private XMultipleResults implMultipleResults;
     private XConnection connection;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
     
     public PostgresqlPreparedStatement(XPreparedStatement impl, XConnection connection) {
         this.impl = impl;
@@ -88,38 +84,27 @@ public class PostgresqlPreparedStatement
     
     @Override
     protected void postDisposing() {
-        isDisposed.set(true);
         try {
             implCloseable.close();
         } catch (SQLException sqlException) {
         }
     }
     
-    private void checkDisposed() {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XPreparedStatement:
     
     public boolean execute() throws SQLException {
-        checkDisposed();
         return impl.execute();
     }
 
     public XResultSet executeQuery() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSet(impl.executeQuery(), this);
     }
 
     public int executeUpdate() throws SQLException {
-        checkDisposed();
         return impl.executeUpdate();
     }
 
     public XConnection getConnection() throws SQLException {
-        checkDisposed();
         return connection;
     }
     
@@ -132,217 +117,175 @@ public class PostgresqlPreparedStatement
     // XPropertySet:
     
     public void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addPropertyChangeListener(arg0, arg1);
     }
 
     public void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addVetoableChangeListener(arg0, arg1);
     }
 
     public XPropertySetInfo getPropertySetInfo() {
-        checkDisposed();
         return implPropertySet.getPropertySetInfo();
     }
 
     public Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         return implPropertySet.getPropertyValue(arg0);
     }
 
     public void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removePropertyChangeListener(arg0, arg1);
     }
 
     public void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removeVetoableChangeListener(arg0, arg1);
     }
 
     public void setPropertyValue(String arg0, Object arg1)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.setPropertyValue(arg0, arg1);
     }
 
     // XCancellable:
     
     public void cancel() {
-        checkDisposed();
         implCancellable.cancel();
     }
 
     // XResultSetMetaDataSupplier:
     
     public XResultSetMetaData getMetaData() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
     }
 
     // XParameters:
     
     public void clearParameters() throws SQLException {
-        checkDisposed();
         implParameters.clearParameters();
     }
 
     public void setArray(int arg0, XArray arg1) throws SQLException {
-        checkDisposed();
         implParameters.setArray(arg0, arg1);
     }
 
     public void setBinaryStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implParameters.setBinaryStream(arg0, arg1, arg2);
     }
 
     public void setBlob(int arg0, XBlob arg1) throws SQLException {
-        checkDisposed();
         implParameters.setBlob(arg0, arg1);
     }
 
     public void setBoolean(int arg0, boolean arg1) throws SQLException {
-        checkDisposed();
         implParameters.setBoolean(arg0, arg1);
     }
 
     public void setByte(int arg0, byte arg1) throws SQLException {
-        checkDisposed();
         implParameters.setByte(arg0, arg1);
     }
 
     public void setBytes(int arg0, byte[] arg1) throws SQLException {
-        checkDisposed();
         implParameters.setBytes(arg0, arg1);
     }
 
     public void setCharacterStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implParameters.setCharacterStream(arg0, arg1, arg2);
     }
 
     public void setClob(int arg0, XClob arg1) throws SQLException {
-        checkDisposed();
         implParameters.setClob(arg0, arg1);
     }
 
     public void setDate(int arg0, Date arg1) throws SQLException {
-        checkDisposed();
         implParameters.setDate(arg0, arg1);
     }
 
     public void setDouble(int arg0, double arg1) throws SQLException {
-        checkDisposed();
         implParameters.setDouble(arg0, arg1);
     }
 
     public void setFloat(int arg0, float arg1) throws SQLException {
-        checkDisposed();
         implParameters.setFloat(arg0, arg1);
     }
 
     public void setInt(int arg0, int arg1) throws SQLException {
-        checkDisposed();
         implParameters.setInt(arg0, arg1);
     }
 
     public void setLong(int arg0, long arg1) throws SQLException {
-        checkDisposed();
         implParameters.setLong(arg0, arg1);
     }
 
     public void setNull(int arg0, int arg1) throws SQLException {
-        checkDisposed();
         implParameters.setNull(arg0, arg1);
     }
 
     public void setObject(int arg0, Object arg1) throws SQLException {
-        checkDisposed();
         implParameters.setObject(arg0, arg1);
     }
 
     public void setObjectNull(int arg0, int arg1, String arg2) throws SQLException {
-        checkDisposed();
         implParameters.setObjectNull(arg0, arg1, arg2);
     }
 
     public void setObjectWithInfo(int arg0, Object arg1, int arg2, int arg3) throws SQLException {
-        checkDisposed();
         implParameters.setObjectWithInfo(arg0, arg1, arg2, arg3);
     }
 
     public void setRef(int arg0, XRef arg1) throws SQLException {
-        checkDisposed();
         implParameters.setRef(arg0, arg1);
     }
 
     public void setShort(int arg0, short arg1) throws SQLException {
-        checkDisposed();
         implParameters.setShort(arg0, arg1);
     }
 
     public void setString(int arg0, String arg1) throws SQLException {
-        checkDisposed();
         implParameters.setString(arg0, arg1);
     }
 
     public void setTime(int arg0, Time arg1) throws SQLException {
-        checkDisposed();
         implParameters.setTime(arg0, arg1);
     }
 
     public void setTimestamp(int arg0, DateTime arg1) throws SQLException {
-        checkDisposed();
         implParameters.setTimestamp(arg0, arg1);
     }
 
     // XPreparedBatchExecution:
     
     public void addBatch() throws SQLException {
-        checkDisposed();
         implPreparedBatchExecution.addBatch();
     }
 
     public void clearBatch() throws SQLException {
-        checkDisposed();
         implPreparedBatchExecution.clearBatch();
     }
 
     public int[] executeBatch() throws SQLException {
-        checkDisposed();
         return implPreparedBatchExecution.executeBatch();
     }
 
     // XWarningsSupplier:
     
     public void clearWarnings() throws SQLException {
-        checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
     public Object getWarnings() throws SQLException {
-        checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
 
     // XMultipleResults:
     
     public boolean getMoreResults() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getMoreResults();
     }
 
     public XResultSet getResultSet() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSet(implMultipleResults.getResultSet(), this);
     }
 
     public int getUpdateCount() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getUpdateCount();
     }
-    
-    
 }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java Sat Sep 16 08:27:31 2017
@@ -21,8 +21,6 @@
 
 package com.sun.star.sdbcx.comp.postgresql;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
@@ -31,7 +29,6 @@ import com.sun.star.beans.XPropertySetIn
 import com.sun.star.beans.XVetoableChangeListener;
 import com.sun.star.container.XNameAccess;
 import com.sun.star.io.XInputStream;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -70,7 +67,6 @@ public class PostgresqlResultSet extends
     private XColumnLocate implColumnLocate;
     private XPropertySet implPropertySet;
     private Object statement;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
     
     public PostgresqlResultSet(XResultSet impl, Object statement) {
         this.impl = impl;
@@ -89,20 +85,13 @@ public class PostgresqlResultSet extends
     // XComponent:
     
     @Override
-    protected synchronized void postDisposing() {
-        isDisposed.set(true);
+    protected void postDisposing() {
         try {
             implCloseable.close();
         } catch (SQLException sqlException) {
         }
     };
     
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XCloseable:
     
     public void close() throws SQLException {
@@ -112,384 +101,311 @@ public class PostgresqlResultSet extends
     // XResultSet:
     
     public boolean absolute(int arg0) throws SQLException {
-        checkDisposed();
         return impl.absolute(arg0);
     }
 
     public void afterLast() throws SQLException {
-        checkDisposed();
         impl.afterLast();
     }
 
     public void beforeFirst() throws SQLException {
-        checkDisposed();
         impl.beforeFirst();
     }
 
     public boolean first() throws SQLException {
-        checkDisposed();
         return impl.first();
     }
 
     public int getRow() throws SQLException {
-        checkDisposed();
         return impl.getRow();
     }
 
     public Object getStatement() throws SQLException {
-        checkDisposed();
         return statement;
     }
 
     public boolean isAfterLast() throws SQLException {
-        checkDisposed();
         return impl.isAfterLast();
     }
 
     public boolean isBeforeFirst() throws SQLException {
-        checkDisposed();
         return impl.isBeforeFirst();
     }
 
     public boolean isFirst() throws SQLException {
-        checkDisposed();
         return impl.isFirst();
     }
 
     public boolean isLast() throws SQLException {
-        checkDisposed();
         return impl.isLast();
     }
 
     public boolean last() throws SQLException {
-        checkDisposed();
         return impl.last();
     }
 
     public boolean next() throws SQLException {
-        checkDisposed();
         return impl.next();
     }
 
     public boolean previous() throws SQLException {
-        checkDisposed();
         return impl.previous();
     }
 
     public void refreshRow() throws SQLException {
-        checkDisposed();
         impl.refreshRow();
     }
 
     public boolean relative(int arg0) throws SQLException {
-        checkDisposed();
         return impl.relative(arg0);
     }
 
     public boolean rowDeleted() throws SQLException {
-        checkDisposed();
         return impl.rowDeleted();
     }
 
     public boolean rowInserted() throws SQLException {
-        checkDisposed();
         return impl.rowInserted();
     }
 
     public boolean rowUpdated() throws SQLException {
-        checkDisposed();
         return impl.rowUpdated();
     }
 
     // XRow:
     
     public XArray getArray(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getArray(arg0);
     }
 
     public XInputStream getBinaryStream(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBinaryStream(arg0);
     }
 
     public XBlob getBlob(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBlob(arg0);
     }
 
     public boolean getBoolean(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBoolean(arg0);
     }
 
     public byte getByte(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getByte(arg0);
     }
 
     public byte[] getBytes(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBytes(arg0);
     }
 
     public XInputStream getCharacterStream(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getCharacterStream(arg0);
     }
 
     public XClob getClob(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getClob(arg0);
     }
 
     public Date getDate(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getDate(arg0);
     }
 
     public double getDouble(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getDouble(arg0);
     }
 
     public float getFloat(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getFloat(arg0);
     }
 
     public int getInt(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getInt(arg0);
     }
 
     public long getLong(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getLong(arg0);
     }
 
     public Object getObject(int arg0, XNameAccess arg1) throws SQLException {
-        checkDisposed();
         return implRow.getObject(arg0, arg1);
     }
 
     public XRef getRef(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getRef(arg0);
     }
 
     public short getShort(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getShort(arg0);
     }
 
     public String getString(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getString(arg0);
     }
 
     public Time getTime(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getTime(arg0);
     }
 
     public DateTime getTimestamp(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getTimestamp(arg0);
     }
 
     public boolean wasNull() throws SQLException {
-        checkDisposed();
         return implRow.wasNull();
     }
 
     // XResultSetMetaDataSupplier:
     
     public XResultSetMetaData getMetaData() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
     }
     
     // XCancellable:
 
     public void cancel() {
-        checkDisposed();
         implCancellable.cancel();
     }
     
     // XWarningsSupplier:
 
     public void clearWarnings() throws SQLException {
-        checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
     public Object getWarnings() throws SQLException {
-        checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
 
     // XResultSetUpdate: 
     
     public void cancelRowUpdates() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.cancelRowUpdates();
     }
 
     public void deleteRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.deleteRow();
     }
 
     public void insertRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.insertRow();
     }
 
     public void moveToCurrentRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.moveToCurrentRow();
     }
 
     public void moveToInsertRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.moveToInsertRow();
     }
 
     public void updateRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.updateRow();
     }
 
     // XRowUpdate:
     
     public void updateBinaryStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateBinaryStream(arg0, arg1, arg2);
     }
 
     public void updateBoolean(int arg0, boolean arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateBoolean(arg0, arg1);
     }
 
     public void updateByte(int arg0, byte arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateByte(arg0, arg1);
     }
 
     public void updateBytes(int arg0, byte[] arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateBytes(arg0, arg1);
     }
 
     public void updateCharacterStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateCharacterStream(arg0, arg1, arg2);
     }
 
     public void updateDate(int arg0, Date arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateDate(arg0, arg1);
     }
 
     public void updateDouble(int arg0, double arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateDouble(arg0, arg1);
     }
 
     public void updateFloat(int arg0, float arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateFloat(arg0, arg1);
     }
 
     public void updateInt(int arg0, int arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateInt(arg0, arg1);
     }
 
     public void updateLong(int arg0, long arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateLong(arg0, arg1);
     }
 
     public void updateNull(int arg0) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateNull(arg0);
     }
 
     public void updateNumericObject(int arg0, Object arg1, int arg2) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateNumericObject(arg0, arg1, arg2);
     }
 
     public void updateObject(int arg0, Object arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateObject(arg0, arg1);
     }
 
     public void updateShort(int arg0, short arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateShort(arg0, arg1);
     }
 
     public void updateString(int arg0, String arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateString(arg0, arg1);
     }
 
     public void updateTime(int arg0, Time arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateTime(arg0, arg1);
     }
 
     public void updateTimestamp(int arg0, DateTime arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateTimestamp(arg0, arg1);
     }
 
     // XColumnLocate:
     
     public int findColumn(String arg0) throws SQLException {
-        checkDisposed();
         return implColumnLocate.findColumn(arg0);
     }
 
     // XPropertySet:
     
     public void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addPropertyChangeListener(arg0, arg1);
     }
 
     public void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addVetoableChangeListener(arg0, arg1);
     }
 
     public XPropertySetInfo getPropertySetInfo() {
-        checkDisposed();
         return implPropertySet.getPropertySetInfo();
     }
 
     public Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         return implPropertySet.getPropertyValue(arg0);
     }
 
     public void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removePropertyChangeListener(arg0, arg1);
     }
 
     public void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removeVetoableChangeListener(arg0, arg1);
     }
 
     public void setPropertyValue(String arg0, Object arg1)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.setPropertyValue(arg0, arg1);
     }
 }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java Sat Sep 16 08:27:31 2017
@@ -21,15 +21,12 @@
 
 package com.sun.star.sdbcx.comp.postgresql;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -53,7 +50,6 @@ public class PostgresqlStatement extends
     private XWarningsSupplier implWarningsSupplier;
     private XMultipleResults implMultipleResults;
     private XConnection connection;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
     
     public PostgresqlStatement(XStatement impl, XConnection connection) {
         this.impl = impl;
@@ -69,40 +65,29 @@ public class PostgresqlStatement extends
     
     @Override
     protected void postDisposing() {
-        isDisposed.set(true);
         try {
             implCloseable.close();
         } catch (SQLException sqlException) {
         }
     }
     
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XStatement:
     
     public boolean execute(String arg0) throws SQLException {
-        checkDisposed();
         System.out.println(arg0);
         return impl.execute(arg0);
     }
 
     public XResultSet executeQuery(String arg0) throws SQLException {
-        checkDisposed();
         XResultSet results = impl.executeQuery(arg0);
         return new PostgresqlResultSet(results, this);
     }
 
     public int executeUpdate(String arg0) throws SQLException {
-        checkDisposed();
         return impl.executeUpdate(arg0);
     }
 
     public XConnection getConnection() throws SQLException {
-        checkDisposed();
         return connection;
     }
 
@@ -115,74 +100,61 @@ public class PostgresqlStatement extends
     // XPropertySet:
     
     public void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addPropertyChangeListener(arg0, arg1);
     }
 
     public void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addVetoableChangeListener(arg0, arg1);
     }
 
     public XPropertySetInfo getPropertySetInfo() {
-        checkDisposed();
         return implPropertySet.getPropertySetInfo();
     }
 
     public Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         return implPropertySet.getPropertyValue(arg0);
     }
 
     public void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removePropertyChangeListener(arg0, arg1);
     }
 
     public void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removeVetoableChangeListener(arg0, arg1);
     }
 
     public void setPropertyValue(String arg0, Object arg1)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.setPropertyValue(arg0, arg1);
     }
 
     // XCancellable:
     
     public void cancel() {
-        checkDisposed();
         implCancellable.cancel();
     }
 
     // XWarningsSupplier:
     
     public void clearWarnings() throws SQLException {
-        checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
     public Object getWarnings() throws SQLException {
-        checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
 
     // XMultipleResults:
     
     public boolean getMoreResults() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getMoreResults();
     }
 
     public XResultSet getResultSet() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSet(implMultipleResults.getResultSet(), this);
     }
 
     public int getUpdateCount() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getUpdateCount();
     }
 }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java Sat Sep 16 08:27:31 2017
@@ -42,9 +42,9 @@ import com.sun.star.sdbcx.comp.postgresq
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors.SdbcxTableDescriptor;
 
 public class PostgresqlTable extends OTable {
-    private PostgresqlTable(Object lock, XConnection connection, OContainer tables, String name,
+    private PostgresqlTable(XConnection connection, OContainer tables, String name,
             String catalogName, String schemaName, String description, String type) {
-        super(lock, name, true, connection, tables);
+        super(name, true, connection, tables);
         super.catalogName = catalogName;
         super.schemaName = schemaName;
         super.description = description;
@@ -53,14 +53,13 @@ public class PostgresqlTable extends OTa
     
     public static PostgresqlTable create(XConnection connection, OContainer tables, String name,
             String catalogName, String schemaName, String description, String type) {
-        Object lock = new Object();
-        return new PostgresqlTable(lock, connection, tables, name, catalogName, schemaName, description, type);
+        return new PostgresqlTable(connection, tables, name, catalogName, schemaName, description, type);
     }
 
     @Override
     public XPropertySet createDataDescriptor() {
         SdbcxTableDescriptor descriptor = SdbcxTableDescriptor.create(true);
-        synchronized (lock) {
+        synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
         return descriptor;
@@ -94,7 +93,7 @@ public class PostgresqlTable extends OTa
     protected OContainer refreshColumns() {
         try {
             List<ColumnDescription> columns = new SqlTableHelper().readColumns(getConnection().getMetaData(), catalogName, schemaName, getName());
-            return new OColumnContainer(lock, isCaseSensitive(), columns, this, getConnection().getMetaData());
+            return new OColumnContainer(this, isCaseSensitive(), columns, this, getConnection().getMetaData());
         } catch (ElementExistException elementExistException) {
             return null;
         } catch (SQLException sqlException) {
@@ -106,7 +105,7 @@ public class PostgresqlTable extends OTa
     protected OContainer refreshIndexes() {
         try {
             List<String> indexes = new SqlTableHelper().readIndexes(getConnection().getMetaData(), catalogName, schemaName, getName(), this);
-            return new OIndexContainer(lock, indexes, isCaseSensitive(), this);
+            return new OIndexContainer(this, indexes, isCaseSensitive(), this);
         } catch (ElementExistException elementExistException) {
             return null;
         } catch (SQLException sqlException) {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java Sat Sep 16 08:27:31 2017
@@ -30,7 +30,6 @@ import com.sun.star.beans.XPropertyChang
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -41,8 +40,8 @@ import com.sun.star.uno.Type;
 public class PropertySet extends ComponentBase implements XPropertySet, XFastPropertySet, XMultiPropertySet {
     private final PropertySetAdapter impl;
     
-    protected PropertySet(Object lock) {
-        impl = new PropertySetAdapter(lock, this);
+    protected PropertySet() {
+        impl = new PropertySetAdapter(this, this);
     }
     
     @Override
@@ -58,23 +57,25 @@ public class PropertySet extends Compone
         impl.registerProperty(propertyName, type, attributes, getter, setter);
     }
 
-    public void addPropertyChangeListener(String propertyName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void addPropertyChangeListener(String propertyName, XPropertyChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // only add listeners if you are not disposed
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.addPropertyChangeListener(propertyName, listener);
         }
     }
 
-    public void addVetoableChangeListener(String propertyName, XVetoableChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void addVetoableChangeListener(String propertyName, XVetoableChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // only add listeners if you are not disposed
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.addVetoableChangeListener(propertyName, listener);
         }
     }
 
-    public void addPropertiesChangeListener(String[] propertyNames, XPropertiesChangeListener listener) {
+    public synchronized void addPropertiesChangeListener(String[] propertyNames, XPropertiesChangeListener listener) {
         // only add listeners if you are not disposed
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.addPropertiesChangeListener(propertyNames, listener);
         }
     }
@@ -83,78 +84,65 @@ public class PropertySet extends Compone
         return impl.getPropertySetInfo();
     }
 
-    public Object getPropertyValue(String propertyName) throws UnknownPropertyException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized Object getPropertyValue(String propertyName) throws UnknownPropertyException, WrappedTargetException {
+        checkDisposed();
         return impl.getPropertyValue(propertyName);
     }
     
     @Override
-    public Object getFastPropertyValue(int handle) throws UnknownPropertyException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized Object getFastPropertyValue(int handle) throws UnknownPropertyException, WrappedTargetException {
+        checkDisposed();
         return impl.getFastPropertyValue(handle);
     }
 
-    public Object[] getPropertyValues(String[] propertyNames) {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized Object[] getPropertyValues(String[] propertyNames) {
+        checkDisposed();
         return impl.getPropertyValues(propertyNames);
     }
 
-    public void removePropertyChangeListener(String propertyName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void removePropertyChangeListener(String propertyName, XPropertyChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // all listeners are automatically released in a dispose call
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.removePropertyChangeListener(propertyName, listener);
         }
     }
 
-    public void removeVetoableChangeListener(String propertyName, XVetoableChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void removeVetoableChangeListener(String propertyName, XVetoableChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // all listeners are automatically released in a dispose call
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.removeVetoableChangeListener(propertyName, listener);
         }
     }
 
-    public void removePropertiesChangeListener(XPropertiesChangeListener listener) {
+    public synchronized void removePropertiesChangeListener(XPropertiesChangeListener listener) {
         // all listeners are automatically released in a dispose call
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.removePropertiesChangeListener(listener);
         }
     }
 
-    public void setPropertyValue(String propertyName, Object value)
+    public synchronized void setPropertyValue(String propertyName, Object value)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+        checkDisposed();
         impl.setPropertyValue(propertyName, value);
     }
 
-    public void setFastPropertyValue(int handle, Object value)
+    public synchronized void setFastPropertyValue(int handle, Object value)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+        checkDisposed();
         impl.setFastPropertyValue(handle, value);
     }
 
-    public void setPropertyValues(String[] propertyNames, Object[] values) throws PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized void setPropertyValues(String[] propertyNames, Object[] values)
+            throws PropertyVetoException, IllegalArgumentException, WrappedTargetException {
+        checkDisposed();
         impl.setPropertyValues(propertyNames, values);
     }
 
-    public void firePropertiesChangeEvent(String[] propertyNames, XPropertiesChangeListener listener) {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized void firePropertiesChangeEvent(String[] propertyNames, XPropertiesChangeListener listener) {
+        checkDisposed();
         impl.firePropertiesChangeEvent(propertyNames, listener);
     }
-    
-    
 }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySetAdapter.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySetAdapter.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySetAdapter.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySetAdapter.java Sat Sep 16 08:27:31 2017
@@ -26,6 +26,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import com.sun.star.beans.Property;
 import com.sun.star.beans.PropertyAttribute;
@@ -56,7 +57,7 @@ public class PropertySetAdapter implemen
     // after registerListeners(), these are read-only:
     private final Map<String,PropertyData> propertiesByName = new HashMap<String,PropertyData>();
     private final Map<Integer,PropertyData> propertiesByHandle = new HashMap<Integer,PropertyData>();
-    private int nextHandle = 1;
+    private AtomicInteger nextHandle = new AtomicInteger(1);
     // interface containers are locked internally:
     protected final MultiTypeInterfaceContainer boundListeners = new MultiTypeInterfaceContainer();
     protected final MultiTypeInterfaceContainer vetoableListeners = new MultiTypeInterfaceContainer();
@@ -145,9 +146,7 @@ public class PropertySetAdapter implemen
             PropertyGetter getter, PropertySetter setter) {
         int handle;
         // registerProperty() should only be called from one thread, but just in case:
-        synchronized (lock) {
-            handle = nextHandle++;
-        }
+        handle = nextHandle.getAndIncrement();
         registerProperty(propertyName, handle, type, attributes, getter, setter);
     }
     

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OCatalog.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OCatalog.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OCatalog.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OCatalog.java Sat Sep 16 08:27:31 2017
@@ -22,7 +22,6 @@
 package com.sun.star.sdbcx.comp.postgresql.sdbcx;
 
 import com.sun.star.container.XNameAccess;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.XServiceInfo;
 import com.sun.star.lib.uno.helper.ComponentBase;
 import com.sun.star.sdbc.SQLException;
@@ -42,7 +41,6 @@ public abstract class OCatalog extends C
             "com.sun.star.sdbcx.DatabaseDefinition"
     };
     
-    protected final Object lock = new Object();
     // Deleted on destruction, weakly held by caller:
     protected OContainer tables;
     protected OContainer views;
@@ -54,27 +52,19 @@ public abstract class OCatalog extends C
         this.metadata = metadata; 
     }
     
-    private void checkDisposed() throws DisposedException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException();
-        }
-    }
-    
     @Override
-    protected void postDisposing() {
-        synchronized (lock) {
-            if (tables != null) {
-                tables.dispose();
-            }
-            if (views != null) {
-                views.dispose();
-            }
-            if (groups != null) {
-                groups.dispose();
-            }
-            if (users != null) {
-                users.dispose();
-            }
+    protected synchronized void postDisposing() {
+        if (tables != null) {
+            tables.dispose();
+        }
+        if (views != null) {
+            views.dispose();
+        }
+        if (groups != null) {
+            groups.dispose();
+        }
+        if (users != null) {
+            users.dispose();
         }
     }
     
@@ -103,47 +93,39 @@ public abstract class OCatalog extends C
     // X(Tables/Views/Groups/Users)Supplier
     
     @Override
-    public XNameAccess getTables() {
+    public synchronized XNameAccess getTables() {
         checkDisposed();
-        synchronized (lock) {
-            if (tables == null) {
-                tables = refreshTables();
-            }
-            return tables;
+        if (tables == null) {
+            tables = refreshTables();
         }
+        return tables;
     }
     
     @Override
-    public XNameAccess getViews() {
+    public synchronized XNameAccess getViews() {
         checkDisposed();
-        synchronized (lock) {
-            if (views == null) {
-                views = refreshViews();
-            }
-            return views;            
+        if (views == null) {
+            views = refreshViews();
         }
+        return views;            
     }
     
     @Override
-    public XNameAccess getGroups() {
+    public synchronized XNameAccess getGroups() {
         checkDisposed();
-        synchronized (lock) {
-            if (groups == null) {
-                groups = refreshGroups();
-            }
-            return groups;
+        if (groups == null) {
+            groups = refreshGroups();
         }
+        return groups;
     }
     
     @Override
-    public XNameAccess getUsers() {
+    public synchronized XNameAccess getUsers() {
         checkDisposed();
-        synchronized (lock) {
-            if (users == null) {
-                users = refreshUsers();
-            }
-            return users;
+        if (users == null) {
+            users = refreshUsers();
         }
+        return users;
     }
     
     protected String buildName(XRow row) throws SQLException {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java Sat Sep 16 08:27:31 2017
@@ -24,7 +24,6 @@ package com.sun.star.sdbcx.comp.postgres
 import com.sun.star.beans.PropertyAttribute;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.container.XNamed;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.sdbc.ColumnValue;
 import com.sun.star.sdbcx.XDataDescriptorFactory;
 import com.sun.star.sdbcx.comp.postgresql.comphelper.CompHelper;
@@ -46,8 +45,8 @@ public class OColumn extends ODescriptor
     private boolean isRowVersion;
     private boolean isCurrency;
     
-    protected OColumn(final Object lock, final boolean isCaseSensitive) {
-        super(lock, "", isCaseSensitive);
+    protected OColumn(final boolean isCaseSensitive) {
+        super("", isCaseSensitive);
         this.isNullable = ColumnValue.NULLABLE;
         this.precision = 0;
         this.scale = 0;
@@ -59,12 +58,10 @@ public class OColumn extends ODescriptor
     }
     
     public static OColumn create(final boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new OColumn(lock, isCaseSensitive);
+        return new OColumn(isCaseSensitive);
     }
     
     protected OColumn(
-            final Object lock,
             final String name,
             final String typeName,
             final String defaultValue,
@@ -77,7 +74,7 @@ public class OColumn extends ODescriptor
             final boolean isRowVersion,
             final boolean isCurrency,
             final boolean isCaseSensitive) {
-        super(lock, name, isCaseSensitive);
+        super(name, isCaseSensitive);
         this.typeName = typeName;
         this.description = description;
         this.defaultValue = defaultValue;
@@ -104,8 +101,7 @@ public class OColumn extends ODescriptor
             final boolean isRowVersion,
             final boolean isCurrency,
             final boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new OColumn(lock, name, typeName, defaultValue, description,
+        return new OColumn(name, typeName, defaultValue, description,
                 isNullable, precision, scale, type, isAutoIncrement, isRowVersion,
                 isCurrency, isCaseSensitive);
     }
@@ -260,18 +256,12 @@ public class OColumn extends ODescriptor
         super.postDisposing();
     }
     
-    private void checkDisposed() {
-        if (bDisposed) {
-            throw new DisposedException();
-        }
-    }
-    
     // XDataDescriptorFactory
     
     @Override
     public XPropertySet createDataDescriptor() {
         SdbcxColumnDescriptor descriptor = SdbcxColumnDescriptor.create(isCaseSensitive());
-        synchronized (lock) {
+        synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
         return descriptor;

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/ODescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/ODescriptor.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/ODescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/ODescriptor.java Sat Sep 16 08:27:31 2017
@@ -31,18 +31,15 @@ import com.sun.star.uno.Type;
 public class ODescriptor extends PropertySet {
     private String name;
     private final boolean isCaseSensitive;
-    protected final Object lock;
     
-    public ODescriptor(Object lock, String name, boolean isCaseSensitive, boolean isReadOnly) {
-        super(lock);
-        this.lock = lock;
+    public ODescriptor(String name, boolean isCaseSensitive, boolean isReadOnly) {
         this.name = name;
         this.isCaseSensitive = isCaseSensitive;
         registerProperties(isReadOnly);
     }
 
-    public ODescriptor(Object lock, String name, boolean isCaseSensitive) {
-        this(lock, name, isCaseSensitive, true);
+    public ODescriptor(String name, boolean isCaseSensitive) {
+        this(name, isCaseSensitive, true);
     }
 
     private void registerProperties(boolean isReadOnly) {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java Sat Sep 16 08:27:31 2017
@@ -45,22 +45,21 @@ public class OIndex extends ODescriptor
     private OTable table;
     private OContainer columns;
     
-    protected OIndex(Object lock, String name, boolean isCaseSensitive, String catalogName,
+    protected OIndex(String name, boolean isCaseSensitive, String catalogName,
             boolean isUnique, boolean isPrimaryKeyIndex, boolean isClustered, List<String> columnNames, OTable table) throws ElementExistException {
-        super(lock, name, isCaseSensitive);
+        super(name, isCaseSensitive);
         this.catalogName = catalogName;
         this.isUnique = isUnique;
         this.isPrimaryKeyIndex = isPrimaryKeyIndex;
         this.isClustered = isClustered;
         this.table = table;
-        columns = new OIndexColumnContainer(lock, this, columnNames);
+        columns = new OIndexColumnContainer(this, this, columnNames);
         registerProperties();
     }
     
     public static OIndex create(String name, boolean isCaseSensitive, String catalogName,
             boolean isUnique, boolean isPrimaryKeyIndex, boolean isClustered, List<String> columnNames, OTable table) throws ElementExistException {
-        final Object lock = new Object();
-        return new OIndex(lock, name, isCaseSensitive, catalogName, isUnique, isPrimaryKeyIndex, isClustered, columnNames, table);
+        return new OIndex(name, isCaseSensitive, catalogName, isUnique, isPrimaryKeyIndex, isClustered, columnNames, table);
     }
     
     private void registerProperties() {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java Sat Sep 16 08:27:31 2017
@@ -33,7 +33,6 @@ public class OIndexColumn extends OColum
     protected boolean isAscending;
     
     protected OIndexColumn(
-            final Object lock,
             final boolean isAscending,
             final String name,
             final String typeName,
@@ -47,7 +46,7 @@ public class OIndexColumn extends OColum
             final boolean isRowVersion,
             final boolean isCurrency,
             final boolean isCaseSensitive) {
-        super(lock, name, typeName, defaultValue, description, isNullable,
+        super(name, typeName, defaultValue, description, isNullable,
                 precision, scale, type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
         this.isAscending = isAscending;
         registerProperties();
@@ -66,8 +65,7 @@ public class OIndexColumn extends OColum
             final boolean isRowVersion,
             final boolean isCurrency,
             final boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new OIndexColumn(lock, isAscending, name, typeName,
+        return new OIndexColumn(isAscending, name, typeName,
                 defaultValue, "", isNullable, precision, scale,
                 type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
     }
@@ -88,7 +86,7 @@ public class OIndexColumn extends OColum
     @Override
     public XPropertySet createDataDescriptor() {
         SdbcxIndexColumnDescriptor descriptor = SdbcxIndexColumnDescriptor.create(isCaseSensitive());
-        synchronized (lock) {
+        synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
         return descriptor;

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java Sat Sep 16 08:27:31 2017
@@ -27,7 +27,6 @@ import com.sun.star.beans.PropertyAttrib
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.container.ElementExistException;
 import com.sun.star.container.XNameAccess;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.sdbc.SQLException;
 import com.sun.star.sdbcx.XColumnsSupplier;
 import com.sun.star.sdbcx.XDataDescriptorFactory;
@@ -49,27 +48,26 @@ public class OKey extends ODescriptor
     
     private OContainer columns;
 
-    protected OKey(Object lock, boolean isCaseSensitive) {
-        super(lock, "", isCaseSensitive);
+    protected OKey(boolean isCaseSensitive) {
+        super("", isCaseSensitive);
         registerProperties();
     }
     
-    protected OKey(Object lock, String name, boolean isCaseSensitive, String referencedTable, int type,
+    protected OKey(String name, boolean isCaseSensitive, String referencedTable, int type,
             int updateRule, int deleteRule, List<String> columnNames, OTable table) throws ElementExistException {
-        super(lock, name, isCaseSensitive);
+        super(name, isCaseSensitive);
         this.referencedTable = referencedTable;
         this.type = type;
         this.updateRule = updateRule;
         this.deleteRule = deleteRule;
         this.table = table;
         registerProperties();
-        columns = new OKeyColumnContainer(lock, this, columnNames);
+        columns = new OKeyColumnContainer(this, this, columnNames);
     }
     
     public static OKey create(String name, boolean isCaseSensitive, String referencedTable, int type,
             int updateRule, int deleteRule, List<String> columnNames, OTable table) throws ElementExistException {
-        final Object lock = new Object();
-        return new OKey(lock, name, isCaseSensitive, referencedTable, type, updateRule, deleteRule, columnNames, table);
+        return new OKey(name, isCaseSensitive, referencedTable, type, updateRule, deleteRule, columnNames, table);
     }
     
     private void registerProperties() {
@@ -107,22 +105,12 @@ public class OKey extends ODescriptor
                 }, null);
     }
 
-    // XComponent
-    
-    private void checkDisposed() {
-        if (bDisposed) {
-            throw new DisposedException();
-        }
-    }
-
     // XColumnsSupplier
     
     @Override
-    public XNameAccess getColumns() {
-        synchronized (lock) {
-            checkDisposed();
-            return columns;
-        }
+    public synchronized XNameAccess getColumns() {
+        checkDisposed();
+        return columns;
     }
     
     // XDataDescriptionFactory

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java Sat Sep 16 08:27:31 2017
@@ -32,13 +32,12 @@ import com.sun.star.uno.Type;
 public class OKeyColumn extends OColumn {
     protected String referencedColumn;
     
-    protected OKeyColumn(Object lock, boolean isCaseSensitive) {
-        super(lock, isCaseSensitive);
+    protected OKeyColumn(boolean isCaseSensitive) {
+        super(isCaseSensitive);
         registerProperties();
     }
     
     protected OKeyColumn(
-            final Object lock,
             final String referencedColumn,
             final String name,
             final String typeName,
@@ -52,7 +51,7 @@ public class OKeyColumn extends OColumn
             final boolean isRowVersion,
             final boolean isCurrency,
             final boolean isCaseSensitive) {
-        super(lock, name, typeName, defaultValue, description, isNullable,
+        super(name, typeName, defaultValue, description, isNullable,
                 precision, scale, type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
         this.referencedColumn = referencedColumn;
         registerProperties();
@@ -71,8 +70,7 @@ public class OKeyColumn extends OColumn
             final boolean isRowVersion,
             final boolean isCurrency,
             final boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new OKeyColumn(lock, referencedColumn, name, typeName,
+        return new OKeyColumn(referencedColumn, name, typeName,
                 defaultValue, "", isNullable, precision, scale,
                 type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
     }
@@ -93,7 +91,7 @@ public class OKeyColumn extends OColumn
     @Override
     public XPropertySet createDataDescriptor() {
         SdbcxKeyColumnDescriptor descriptor = SdbcxKeyColumnDescriptor.create(isCaseSensitive());
-        synchronized (lock) {
+        synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
         return descriptor;

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OTable.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OTable.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OTable.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OTable.java Sat Sep 16 08:27:31 2017
@@ -25,7 +25,6 @@ import com.sun.star.beans.PropertyAttrib
 import com.sun.star.container.XIndexAccess;
 import com.sun.star.container.XNameAccess;
 import com.sun.star.container.XNamed;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.XServiceInfo;
 import com.sun.star.sdbc.XConnection;
 import com.sun.star.sdbcx.XAlterTable;
@@ -57,8 +56,8 @@ public abstract class OTable extends ODe
     protected OContainer indexes;
     protected OContainer tables;
     
-    protected OTable(Object lock, String name, boolean isCaseSensitive, XConnection connection, OContainer tables) {
-        super(lock, name, isCaseSensitive);
+    protected OTable(String name, boolean isCaseSensitive, XConnection connection, OContainer tables) {
+        super(name, isCaseSensitive);
         this.tables = tables;
         this.connection = connection;
         registerProperties();
@@ -114,12 +113,6 @@ public abstract class OTable extends ODe
         tables = null;
     }
     
-    private void checkDisposed() {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException();
-        }
-    }
-    
     // XServiceInfo
     
     @Override
@@ -145,36 +138,29 @@ public abstract class OTable extends ODe
     // XColumnsSupplier
     
     @Override
-    public XNameAccess getColumns() {
-        checkDisposed();
-        synchronized (lock) {
-            if (columns == null) {
-                columns = refreshColumns();
-            }
-            return columns;
+    public synchronized XNameAccess getColumns() {
+        if (columns == null) {
+            columns = refreshColumns();
         }
+        return columns;
     }
     
     @Override
-    public XNameAccess getIndexes() {
+    public synchronized XNameAccess getIndexes() {
         checkDisposed();
-        synchronized (lock) {
-            if (indexes == null) {
-                indexes = refreshIndexes();
-            }
-            return indexes;
+        if (indexes == null) {
+            indexes = refreshIndexes();
         }
+        return indexes;
     }
     
     @Override
-    public XIndexAccess getKeys() {
+    public synchronized XIndexAccess getKeys() {
         checkDisposed();
-        synchronized (lock) {
-            if (keys == null) {
-                keys = refreshKeys();
-            }
-            return keys;
+        if (keys == null) {
+            keys = refreshKeys();
         }
+        return keys;
     }
     
     public XConnection getConnection() {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java Sat Sep 16 08:27:31 2017
@@ -39,14 +39,13 @@ public class SdbcxColumnDescriptor exten
     protected String defaultValue;
     protected boolean isCurrency;
     
-    protected SdbcxColumnDescriptor(Object lock, boolean isCaseSensitive) {
-        super(lock, "", isCaseSensitive, false);
+    protected SdbcxColumnDescriptor(boolean isCaseSensitive) {
+        super("", isCaseSensitive, false);
         registerProperties();
     }
     
     public static SdbcxColumnDescriptor create(boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new SdbcxColumnDescriptor(lock, isCaseSensitive);
+        return new SdbcxColumnDescriptor(isCaseSensitive);
     }
     
     private void registerProperties() {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java Sat Sep 16 08:27:31 2017
@@ -29,14 +29,13 @@ import com.sun.star.uno.Type;
 public class SdbcxIndexColumnDescriptor extends SdbcxColumnDescriptor {
     protected boolean isAscending;
     
-    protected SdbcxIndexColumnDescriptor(Object lock, boolean isCaseSensitive) {
-        super(lock, isCaseSensitive);
+    protected SdbcxIndexColumnDescriptor(boolean isCaseSensitive) {
+        super(isCaseSensitive);
         registerProperties();
     }
     
     public static SdbcxIndexColumnDescriptor create(boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new SdbcxIndexColumnDescriptor(lock, isCaseSensitive);
+        return new SdbcxIndexColumnDescriptor(isCaseSensitive);
     }
     
     private void registerProperties() {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java Sat Sep 16 08:27:31 2017
@@ -35,15 +35,14 @@ public class SdbcxIndexDescriptor extend
     
     private SdbcxIndexColumnDescriptorContainer columns;
     
-    protected SdbcxIndexDescriptor(Object lock, boolean isCaseSensitive) {
-        super(lock, "", isCaseSensitive, false);
-        columns = new SdbcxIndexColumnDescriptorContainer(this.lock, isCaseSensitive());
+    protected SdbcxIndexDescriptor(boolean isCaseSensitive) {
+        super("", isCaseSensitive, false);
+        columns = new SdbcxIndexColumnDescriptorContainer(this, isCaseSensitive());
         registerProperties();
     }
     
     public static SdbcxIndexDescriptor create(boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new SdbcxIndexDescriptor(lock, isCaseSensitive);
+        return new SdbcxIndexDescriptor(isCaseSensitive);
     }
     
     private void registerProperties() {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java Sat Sep 16 08:27:31 2017
@@ -29,14 +29,13 @@ import com.sun.star.uno.Type;
 public class SdbcxKeyColumnDescriptor extends SdbcxColumnDescriptor {
     protected String relatedColumn;
     
-    protected SdbcxKeyColumnDescriptor(Object lock, boolean isCaseSensitive) {
-        super(lock, isCaseSensitive);
+    protected SdbcxKeyColumnDescriptor(boolean isCaseSensitive) {
+        super(isCaseSensitive);
         registerProperties();
     }
     
     public static SdbcxKeyColumnDescriptor create(boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new SdbcxKeyColumnDescriptor(lock, isCaseSensitive);
+        return new SdbcxKeyColumnDescriptor(isCaseSensitive);
     }
     
     private void registerProperties() {

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java?rev=1808517&r1=1808516&r2=1808517&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java Sat Sep 16 08:27:31 2017
@@ -37,15 +37,14 @@ public class SdbcxKeyDescriptor extends
     
     private SdbcxKeyColumnDescriptorContainer columns;
     
-    protected SdbcxKeyDescriptor(Object lock, boolean isCaseSensitive) {
-        super(lock, "", isCaseSensitive, false);
+    protected SdbcxKeyDescriptor(boolean isCaseSensitive) {
+        super("", isCaseSensitive, false);
         registerProperties();
-        columns = new SdbcxKeyColumnDescriptorContainer(this.lock, isCaseSensitive());
+        columns = new SdbcxKeyColumnDescriptorContainer(this, isCaseSensitive());
     }
     
     public static SdbcxKeyDescriptor create(boolean isCaseSensitive) {
-        final Object lock = new Object();
-        return new SdbcxKeyDescriptor(lock, isCaseSensitive);
+        return new SdbcxKeyDescriptor(isCaseSensitive);
     }
     
     private void registerProperties() {