incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1043563 - /incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
Date Wed, 08 Dec 2010 18:06:01 GMT
Author: rmatthews
Date: Wed Dec  8 18:06:01 2010
New Revision: 1043563

URL: http://svn.apache.org/viewvc?rev=1043563&view=rev
Log:
Making it more obvious that an object that is being destroy/deleted from the system must be
resolved so it has a version object associated with it.  Otherwise the object store will check
the version and fail.

Modified:
    incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/PersistenceSessionObjectStore.java

Modified: incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/PersistenceSessionObjectStore.java?rev=1043563&r1=1043562&r2=1043563&view=diff
==============================================================================
--- incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
(original)
+++ incubator/isis/trunk/core/runtime/src/main/java/org/apache/isis/core/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
Wed Dec  8 18:06:01 2010
@@ -64,6 +64,7 @@ import org.apache.isis.core.runtime.pers
 import org.apache.isis.core.runtime.persistence.oidgenerator.OidGenerator;
 import org.apache.isis.core.runtime.persistence.query.PersistenceQuery;
 import org.apache.isis.core.runtime.transaction.IsisTransactionManager;
+import org.apache.isis.core.runtime.transaction.ObjectPersistenceException;
 import org.apache.isis.core.runtime.transaction.TransactionalClosureAbstract;
 import org.apache.isis.core.runtime.transaction.TransactionalClosureWithReturnAbstract;
 import org.apache.isis.core.runtime.transaction.updatenotifier.UpdateNotifier;
@@ -426,6 +427,9 @@ public class PersistenceSessionObjectSto
 
             @Override
             public void execute() {
+                if (adapter.getVersion() == null) {
+                    throw new ObjectPersistenceException("Object to be deleted does not have
a version (maybe it should be reolved first): " + adapter);
+                }
                 final DestroyObjectCommand command = objectStore.createDestroyObjectCommand(adapter);
                 getTransactionManager().addCommand(command);
             }



Mime
View raw message