* Do not mark prototype as updated in database when modifying the
_prototype property on transient objects. Fixes bug 572. <http://helma.org/bugs/show_bug.cgi?id=572> * Tentative fix for bug 573: Calling HopObject.persist() on already persistent object causes object to be updated in database. <http://helma.org/bugs/show_bug.cgi?id=573>
This commit is contained in:
parent
1b873d3e11
commit
7258b95fcb
1 changed files with 7 additions and 2 deletions
|
@ -2093,7 +2093,7 @@ public final class Node implements INode, Serializable {
|
|||
}
|
||||
|
||||
// check if the property we're setting specifies the prototype of this object.
|
||||
if (dbmap.getPrototypeField() != null &&
|
||||
if (state != TRANSIENT &&
|
||||
propname.equals(dbmap.columnNameToProperty(dbmap.getPrototypeField()))) {
|
||||
DbMapping newmap = nmgr.getDbMapping(value);
|
||||
|
||||
|
@ -2557,7 +2557,12 @@ public final class Node implements INode, Serializable {
|
|||
* Public method to make a node persistent.
|
||||
*/
|
||||
public void persist() {
|
||||
makePersistable();
|
||||
if (state == TRANSIENT) {
|
||||
makePersistable();
|
||||
} else if (state == CLEAN) {
|
||||
markAs(MODIFIED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue