cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Øyvind Harboe" <>
Subject Problems with DataContext being null in object
Date Mon, 18 Dec 2006 21:27:49 GMT
Under which circumstances can a Cayenne Data Object have it's Data
Context set to null?

I see 5 (five!) cases:

- application invokes setDataContext(null)
- Cayenne rolls back a new uncommitted object.
- committed deleted object
- serialize + deserialize
- explicit invalidation/unregistering of objects

a) is this list complete? I'm using Cayenne 1.2

b) This makes me wonder whether the following construct is safe in
*all* cases. Especially I'm a bit concerned about what happens when
this is executed on a DataContext:

// roll back after a successful commit is *supposed* to be a no-op, so we
// execute this always for simplicity
// or is it?????

(The persistance="yes" thingy I wrote today is a real concern for our
app, but not the culprit for my particular problems right now.)

Øyvind Harboe

View raw message