You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This DBObject is intended to replace the AsyncTrigger, and dramatically simplify transactional processing and recovery. If it helps to explain its raison d'être, it is analogous in some ways to a "message driven bean" in Javaland. It allows for behavior to be deferred from the current transaction to some later point in time (by default, immediately after this transaction commits), thus de-coupling potentially expensive and rollback-happy logic from an existing transaction, while still guaranteeing that the processing will occur.
Consider the following half-baked example:
const Overdraft(Int accountId, Int balance);
mixin OverdraftPenalizer
into DBProcessor<Overdraft>
{
@Override
void process(Overdraft overdraft)
{
//...
}
}
// in the application's database schema
@RO OverdraftPenalizer penalties;
// somewhere else in the application, during a transaction
penalties.schedule(overdraft).at(Time:00:00).priority(Low);
The "ripple" concept (terminology originating in Coherence) is also easily accomplished with the DBProcessor. A trigger on a DBObject, for example, can schedule a follow-up processing task for any change that creates a ripple, and each processing task can change data, which triggers can extend that ripple further. Conceptually, the positive feedback loop from such a feature is capable of being world-ending; this is one of the reasons why the DBProcessor supports prioritization and suspension. I'm going to guess that Cliff will have some opinions on this topic 🤔 since the H2O system apparently had similar capabilities, and he has some battle scars to prove it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Introducing: DBProcessor
This DBObject is intended to replace the AsyncTrigger, and dramatically simplify transactional processing and recovery. If it helps to explain its raison d'être, it is analogous in some ways to a "message driven bean" in Javaland. It allows for behavior to be deferred from the current transaction to some later point in time (by default, immediately after this transaction commits), thus de-coupling potentially expensive and rollback-happy logic from an existing transaction, while still guaranteeing that the processing will occur.
Consider the following half-baked example:
The "ripple" concept (terminology originating in Coherence) is also easily accomplished with the DBProcessor. A trigger on a DBObject, for example, can schedule a follow-up processing task for any change that creates a ripple, and each processing task can change data, which triggers can extend that ripple further. Conceptually, the positive feedback loop from such a feature is capable of being world-ending; this is one of the reasons why the DBProcessor supports prioritization and suspension. I'm going to guess that Cliff will have some opinions on this topic 🤔 since the H2O system apparently had similar capabilities, and he has some battle scars to prove it.
Beta Was this translation helpful? Give feedback.
All reactions