Package net.sf.basedb.core
Class DerivedBioAssay.FixDerivedBioAssayParentsRecursivelyAction
java.lang.Object
net.sf.basedb.core.DerivedBioAssay.FixDerivedBioAssayParentsRecursivelyAction
- All Implemented Interfaces:
TransactionalAction
- Enclosing class:
- DerivedBioAssay
static class DerivedBioAssay.FixDerivedBioAssayParentsRecursivelyAction
extends Object
implements TransactionalAction
Whenever we modify the parent items to a derived bioassay,
we must make sure that the physical bioassays for all
child items are synchronized with the same changes.
This is a bit complicated due to the fact that a single transaction
may affect multiple derived bioassays at different levels in
the parent-child tree. The fix must be made top-down and
must handle accidentally created circular references.
Whenever a change is deteced a single instance of this
class is associated with the DbControl. All changed
derived bioassays are collected with the
add(DerivedBioAssayData)
method. The actual fix is done as a last step before committing
the transaction onBeforeCommit()
.-
Field Summary
Modifier and TypeFieldDescriptionprivate final Set<DerivedBioAssayData>
private static Map<DbControl,
DerivedBioAssay.FixDerivedBioAssayParentsRecursivelyAction> private final DbControl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
add
(DerivedBioAssayData dba) Register the given derived bioassay as one that has had it's parent items changed.(package private) static DerivedBioAssay.FixDerivedBioAssayParentsRecursivelyAction
Get an instance tht handles the fixes for the given DbControl.void
Called after a successful commit.void
This method is called before the commit is about to happen.void
Called after an unsuccessful commit.
-
Field Details
-
cache
-
dc
-
allModified
-
-
Constructor Details
-
FixDerivedBioAssayParentsRecursivelyAction
-
-
Method Details
-
get
Get an instance tht handles the fixes for the given DbControl. If no instance exists yet, a new one is created. -
add
Register the given derived bioassay as one that has had it's parent items changed. -
onBeforeCommit
public void onBeforeCommit()Description copied from interface:TransactionalAction
This method is called before the commit is about to happen. If this method throws an exception the transaction will be rolled back.- Specified by:
onBeforeCommit
in interfaceTransactionalAction
-
onAfterCommit
public void onAfterCommit()Description copied from interface:TransactionalAction
Called after a successful commit. Implementations should not throw any exceptions from this method. If they do, the message is logged, by no other action is taken.- Specified by:
onAfterCommit
in interfaceTransactionalAction
-
onRollback
public void onRollback()Description copied from interface:TransactionalAction
Called after an unsuccessful commit. Implementations should not throw any exceptions from this method. If they do, the message is logged, by no other action is taken.- Specified by:
onRollback
in interfaceTransactionalAction
-