Further testing shows that GRAPH_FLUSHED_SUBJECT would be DID_COMMIT not WILL_COMMIT. So I'm still unable to get a single one-time notification before a DataContext will commit a transaction.
On Fri, Sep 13, 2013 at 2:39 PM, Mike Kienenberger <[email protected]> wrote: > So right after I sent my last message, I realized that while > DataContext.WILL_COMMIT was gone, EventManager was still around. > > I did a quick search to see what kind of events were published, and I > saw this one: > > DataChannel.GRAPH_FLUSHED_SUBJECT > > Is this equivalent to the DataContext.WILL_COMMIT event? > > > > On Fri, Sep 13, 2013 at 2:32 PM, Mike Kienenberger <[email protected]> wrote: >> So I'm finally making the attempt to upgrade my ancient Cayenne >> project from 1.1 to 3.x. >> >> The one kind of compile error I still haven't resolved is registering >> for a data context commit. >> >> I know I can register individual PrePersist, PreRemove, and PreUpdate >> callbacks for individual entity types, but I don't see how I be >> notified of with a single DataContext.WILL_COMMIT event once before >> each context.commit(). >> >> >> I see three problems with trying to use the individual callbacks: >> >> - Huge performance hit of being notified for each and every entity committed >> >> - Another performance hit of setting up lifecycle notification by >> iterating through the runtime metadata to register every existing >> entity type for each of the three pre-commit listeners >> >> and >> >> - If nothing gets changed by the commit, then I would still get no >> notification.
