We started on something similar to the #1 option you have mentioned. We realized having a shared RDBMS instance for hosting the EA repository/project was leading to a lot of problems. We are now evaluating if/how we need to implement #2 option.
In any case, we are looking for any best practices on how to work with a shared-repository
Some Java code that could be useful for you. Look at
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/project_2.html and
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/repository3.html as well.
******************************************
import org.sparx.*;
public class EAModelXMIExporter {
public static void main(String[] args) {
Repository r = new Repository();
r.OpenFile("DBType=3;Connect=provider=oraoledb.oracle.1;password=tiger;persist security info=true;user id=scott;data source=devdb2");
Project p = r.GetProjectInterface();
Collection models = r.GetModels();
int nModels = (int) models.GetCount();
for (int loopi = 0; loopi < nModels; loopi++) {
org.sparx.Package pkg = (org.sparx.Package) models.GetAt((short)loopi);
String strPkgName = pkg.GetName();
if (strPkgName.equals("my_root_package_name")) {
System.out.println("Exporting package: " + strPkgName);
p.ExportPackageXMI (pkg.GetPackageGUID(), EnumXMIType.xmiEA21, 1, -1, 1, 0, "C:\\somedirectory\\" + strPkgName + "_exported-“ + System.currentTimeMillis() + ”.xml");
System.out.println("Exported package: " + strPkgName);
}
}
}
}
******************************************