static final synchronized MyRelation assertRelation(CallingContext cc) throws ODKDatastoreException { MyRelation relationPrototype; Datastore ds = cc.getDatastore(); User user = cc.getUserService().getDaemonAccountUser(); relationPrototype = new MyRelation(ds.getDefaultSchemaName()); ds.assertRelation(relationPrototype, user); // may throw exception... // at this point, the prototype has become fully populated return relationPrototype; // set static variable only upon success... }