I have the following code:
List<Assignment> assignments = objectContext.performQuery(assignmentQuery);
objectContext.commitChanges();
objectContext.deleteObjects(assignments);
objectContext.commitChanges();
I do the first commitChanges()
to commit all the queries. Then I clear Cayenne's log. On the second commitChanges()
, this shows up on the log:
INFO : QueryLogger.logBeginTransaction: 2013-07-10 07:37:11,214: --- transaction started.
INFO : QueryLogger.logQuery: 2013-07-10 07:37:11,218: INSERT INTO scheduler_assignment
...
INFO : QueryLogger.logQuery: 2013-07-10 07:37:11,241: DELETE FROM scheduler_assignment
...
INFO : QueryLogger.logCommitTransaction: 2013-07-10 07:37:11,286: +++ transaction committed.
I don't understand why it is doing the INSERT statement when I'm trying to delete. Can anyone explain? Thanks!