import freemarker.template.*;
-import webdb.storage.*;
-import webdb.entity.*;
-import webdb.misc.*;
+import mir.storage.*;
+import mir.entity.*;
+import mir.misc.*;
/**
* <b>Diese Klasse implementiert die Datenbankverbindung zur MetaObjekt-Tabelle
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();
super();
this.hasTimestamp = false;
this.theTable="img_type";
- try { this.theEntityClass = Class.forName("mir.entity.EntityImageType"); }
- catch (Exception e) { throw new StorageObjectException(e.toString()); }
}
- public SimpleList getPopupData() { return getPopupData("name",true); }
+ public SimpleList getPopupData()
+ throws StorageObjectException { return getPopupData("name",true); }
}