bugfixes mainly...
[mir.git] / source / mircoders / storage / DatabaseImageType.java
index 4cd78d4..9470085 100755 (executable)
@@ -22,7 +22,11 @@ public class DatabaseImageType extends Database implements StorageObject{
        private static DatabaseImageType instance;
        private static SimpleList publisherPopupData;
 
-       public static DatabaseImageType getInstance() throws StorageObjectException
+       // the following *has* to be sychronized cause this static method
+       // could get preemted and we could end up with 2 instances of DatabaseFoo..
+       // see the "Singletons with needles and thread" article at JavaWorld -mh
+       public synchronized static DatabaseImageType getInstance() 
+         throws StorageObjectException
        {
                if (instance == null) {
                        instance = new DatabaseImageType();
@@ -38,7 +42,8 @@ public class DatabaseImageType extends Database implements StorageObject{
                this.theTable="img_type";
        }
 
-       public SimpleList getPopupData() { return getPopupData("name",true); }
+       public SimpleList getPopupData()
+        throws StorageObjectException { return getPopupData("name",true); }
 
 
 }