cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Grobmeier <grobme...@gmail.com>
Subject Re: Configuration Class?
Date Mon, 25 Jul 2011 16:17:53 GMT
>> You wrote, ObjectContext is some kind of a "disconnected" object. If I
>> create two new objects in the ObjectContext, when does the transaction
>> start exactly?
>
> When you call ObjectContext.commitChanges() (or performQuery() for that matter). Tx is
started when an operation reaches DataDomain. Check uses of non-public DataDomain.runInTransaction()
- this is the method that does tx wrapping.
>
>> Is it when I call "registerNew" on the first object or
>> is it when I commit my changes (it then would create a transaction,
>> commit both new objects, close transaction)?
>
> The later. Any changes to objects within a context are not wrapped in a transaction,
can span multiple requests, etc., etc.

Cool, makes all sense - thanks!

Mime
View raw message