http://www.avromroyfaderman.com/2008/06/the-business-logic-wars/
--
Avrom’s Java EE and Oracle ADF Blog
http://www.avromroyfaderman.com
> The point - I begin to suspect that you've got to go all one way or
> the other. Either all validation is in the middle tier, and there are
> NO triggers in your database (I'll make a concession to allow
> constraints - the ADF BC framework seems to understand constraints),
> or all updates are through an API.
Or you put in a bit of framework code (or, if it makes more sense,
individual entity level code) to help integrate the two tiers. In your
case:
protected void doDML(int operation, TransactionEvent e) {
try {
super.doDML(operation, e);
} catch (DMLException e) {
refresh(REFRESH_WITH_DB_FORGET_CHANGES | REFRESH_REMOVE_NEW_ROWS);
//Throw some sort of exception so the user knows what happened
}
}
For most purposes (e.g., if this is a form) I actually don't think you
want to do this (you'll lose the user's work), but if you really want
failed posts to remove new data from the cache, this will do it.
For more of this sort of stuff, another plug (banner day for it, I see):
http://www.avromroyfaderman.com/2008/06/business-components-without-the-business-part-i/
http://www.avromroyfaderman.com/2008/06/business-components-without-the-business-part-ii/
http://www.avromroyfaderman.com/2008/07/business-components-without-the-business-part-iii/
Best,
Avrom
I was referring to updates and inserts using PL/SQL tables rather than
selects, though I'm sure that isn't rocket science either.
Considering the bang for the buck you get using JDev's wizards, having to
manually code around those types of issues makes using stored procedures
that take those types of parameters much more difficult to implement in ADF
than updating tables directly and having the rest of the business logic on
your middle tier.
-Rob