On Jul 25, 2011, at 7:01 PM, Christian Grobmeier wrote:

> 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.

Andrus

Reply via email to