don't request write lock in constructor for relational objects

This commit is contained in:
hns 2001-08-22 00:11:12 +00:00
parent 0ea389b663
commit af41c07c8b

View file

@ -183,7 +183,7 @@ public final class Node implements INode, Serializable {
this.nmgr = nmgr; this.nmgr = nmgr;
setParent (home); setParent (home);
// this.dbmap = null; // this.dbmap = null;
// generate a key for the virtual node that can't be mistaken for a JDBC-URL // generate a key for the virtual node that can't be mistaken for a Database Key
primaryKey = new SyntheticKey (home.getKey (), propname); primaryKey = new SyntheticKey (home.getKey (), propname);
this.id = primaryKey.getID (); this.id = primaryKey.getID ();
this.name = propname; this.name = propname;
@ -201,12 +201,10 @@ public final class Node implements INode, Serializable {
dbmap = nmgr.getDbMapping (prototype); dbmap = nmgr.getDbMapping (prototype);
// the id is only generated when the node is actually checked into db. // the id is only generated when the node is actually checked into db.
// id = nmgr.generateID (dbmap); // id = nmgr.generateID (dbmap);
// checkWriteLock ();
this.name = n == null ? "" : n; this.name = n == null ? "" : n;
created = lastmodified = System.currentTimeMillis (); created = lastmodified = System.currentTimeMillis ();
adoptName = true; adoptName = true;
state = TRANSIENT; state = TRANSIENT;
// markAs (TRANSIENT);
} }
@ -235,7 +233,7 @@ public final class Node implements INode, Serializable {
this.dbmap = m; this.dbmap = m;
id = rec.getValue (dbmap.getIDField ()).asString (); id = rec.getValue (dbmap.getIDField ()).asString ();
checkWriteLock (); // checkWriteLock ();
String nameField = dbmap.getNameField (); String nameField = dbmap.getNameField ();
name = nameField == null ? id : rec.getValue (nameField).asString (); name = nameField == null ? id : rec.getValue (nameField).asString ();
if (name == null || name.length() == 0) if (name == null || name.length() == 0)