Hi all, hi Armin,
Using TwoLevelCacheObjectImpl, i experienced some big troubles with a
delete sequence containing some flush() to avoid FK constraints errors.
Assume 2 classes A and B, with 1:n relation.
We can resume sequence as this :
- open tx
- read object A
- read collection of object B
{
- lock object B
- set null to reference object A in B object
}
- flush() (with TxExt method) (normally database FK are null now for
database connection)
- read collection of object B
{
- delete B ( database.deletePersistent method)
}
- commit tx
The troubles don't occur with DefaultObjectCacheImpl.
Hum, did i miss another way to flush database with 2LCache ?
Another question ( different) :
Is there a way to get the running transaction without no reference as
Transaction (kind of join with the running thread) ? in the way to get the
broker of the transaction.
Regards