SlideShare a Scribd company logo
ADF Developers – make the database work for youODTUG Kaleidoscope 2011 – Long Beach, CaliforniaLuc Bors, AMIS, The Netherlands
DesktopBrowser-BasedMetadata Services (MDS)Oracle ADF – Role of the DatabaseJSFJSPOfficeADFSwingMobileViewADF Faces      JSFStrutsADF ControllerControllerADF BindingModelBusiness ServicesEJBBAMADFbcPortletsBIBPELWeb ServicesJavaData ServicesDatabaseWeb ServicesLegacy SystemsApps Unlimited
“We could also do that in the database”in the database? Huh?RDBMS≈
Design & team that combines strengths of all technologies…Ease and Elegance of Implementation
Functionality (in an affordable way)
Productivity
PerformanceADF Controller/ADF FacesADF ModelADF BC/JPA/WS*Oracle RDBMS
Database StrengthsIntegrityFine grained (data) security and auditingData Retrieval joining tables together, leveraging indexeshierarchical, network-like traversals advanced analytics, historical queries, mining Aggregation and SortingComplex & Massive Data Manipulation
RDBMS not always exclusively accessed through one Java APISOA, ESB, WebServicesDatabaseBatch Bulk ProcessesStandard ApplicationsLegacyApplicationsData Replication & Synchronization
Database Triggers – decorating Data ManipulationTriggers execute before or after Insert, Update or Delete of database recordsinsert, update, deleteBefore Insert trigger: sal=…Employees
Purpose of triggersSet default values on new recordsif :new.job=‘SALESMAN’ then :new.comm = 1000Calculate & Derive values upon insert, update or deleteNotify third parties of data manipulationPerform complex validation on the data changes applied by the transactionPer Department: Max Salary < 1.8 * AveragePer Manager: #subordinates < 15
ADF BC refreshing Entity Objects after triggers have applied new valuesEntity Object Employee(leveraging: returning <column> into : bind)postBefore Insert trigger: sal=…Employees
Aggregation & RollupData for reporting purposes can be prepared by database queriesIncluding aggregations(max/min/avg/count/sum)and Sub Totals and Grand Totaland String Aggregation
Dynamic Aggregation through Non-conventional use of bind parametersBind parameters are typically used in the WHERE clause of a SQL queryHowever: they can also be used in the SELECT, ORDER BY and GROUP BY sectionsA combination of CASE and bind parameters in the GROUP BY can provide interesting optionsDynamicAggregation
Query for dynamic aggregation
Sub and Grandtotals with RollupRollup instructs databaseto aggregate at every levelstarting from the rightdeptno, jobdeptno(grand total)Also see:CubeGroupingSets
Leveraging SQL Aggregation to make life easier for the UI developer
Analytical Functions – spreadsheet-style row processingAnalytical Functions allow SQL queries to perform inter-row comparison & aggregationFor example: in a single query, for each employeeshow salary rank in department and jobshow salary difference with colleague next higher in rank (on the list per department)show average salary in the departmentshow csv list of colleagues in department
Analytical Functions - example
Flashback Queryselect emp.*,      dept.dnamefrom   emp AS OF TIMESTAMP                  (SYSTIMESTAMP - INTERVAL '1' DAY) ,      deptwhere  emp.deptno = dept.deptno
Show historic situation for selected records
Flashback VersionsRetrieve all states each record has been inEvery transaction that touched a row left a version of the recordPseudocolumns: xid, operation, start time, end timeUse constants minvalueand maxvalueto retrieve all versionsFlashback versions make journaling tables redundant
Employee Version-history with Flashback Query
Show change history for a record based on Flashback versions
Embedding Historic Data in ADF ApplicationWhere Clause in (read only) ViewObject can include FLASHBACK operatorsAS OF and VERSIONS BETWEENBind parameters can be used to set the point in time or the historic time intervalA time selector can be used to visually set the intervalScalar subqueries can be used for ‘in line comparison to a certain point in time’“How much higher/lower is the salary than at the selected date?”
Trees
Trees
ADF Model & Tree Data BindingCreate hierarchical relation between multiple ViewObject or (POJO) Collection BindingsTree Data Retrieval retrieves collections in several steps i.e. multiple queriesData is cachedData is only queried when required (given the expansion level of the tree)Alternatively: have the database do the heavy tree lifting: Database has optimized tree algorithmsStarting at any node in the tree or networkDrilling down to the specified number of levelsOrder siblings within parentIndicate leaf and parent nodes; detect cycles
Retrieving Hierarchical data sets with single SQL statementsDatabase has optimized algorithmsStarting at any node in the tree or networkDrilling down to the specified number of levelsOrder siblings within parentIndicate leaf and parent nodes; detect cyclesEMPID           ENAME             MGR     DEPTNO      LEVEL--------------- ---------- ---------- ---------- ----------  7839          KING                          10          1    7698        BLAKE            7839         30          2      7499      ALLEN            7698         30          3      7900      JAMES            7698         30          3      7654      MARTIN           7698         30          3      7844      TURNER           7698         30          3      7521      WARD             7698         30          3    7782        CLARK            7839         10          2      7934      MILLER           7782         10          3
Oracle 11g and ANSI SQL for hierarchical querywith employees (empno, name, mgr, hierlevel, path) as ( select empno, ename, mgr, 1, ename  from   emp  where  mgr is null  union all  select e.empno, e.ename  ,      e.mgr, m.hierlevel + 1  ,      m.path||'/'||e.ename  from   emp e         join         employees m         on (m.empno = e.mgr) )select *from   employees
Filter-driven queryingFilteredEmp
Steps for filter driven queryingDetermine the values to filter onCreate a query to retrieve for all filtersEvery individual value and the # occurrencesThe where-clause to apply on the real VOThe label for the filterCreate a managed bean to apply selected filtersto ViewObjectCreate page that displays filters and selected dataand handles filter “clicks”
Encapsulate Database specific SQL in a View APIViews – for encapsulation of data model, multi-table join, (advanced) SQL hiding, authorization rulesNote: a view looks like a table to the clientView
The read-only cursor APIA Cursor is a  reference to a query result setDatabase can open a cursor for a SQL queryAnd return it to the application to fetch the rows fromCursor == JDBCResultSetA cursor can be nested: containdetails … JDBC ResultSetwhile rs.next {   … }cursorStored ProcedureDepartmentsSQLEmployees
Cursor for Master-Detail resultsetStored Procedure
Using Complex Views for Hiding Legacy Data Models
Providing a ‘business object’ APIDML API: a View – aided by an Instead Of triggerInsert of one new row inUSERS_VW (e.g. a JPApersist operation) can actually be four new recordsUSER, PERSON, EMAIL_TYPEEMAIL_ADDRESSUSERSUSERSEMAIL_TYPEInstead Of DML trigger**PERSONSEMAIL_ADDRESSES**
Instead of Insert Trigger on USERS_VW (1/2)create or replace trigger handle_insert_users_trginstead of insert on users_vwfor each row declare  l_psn_id persons.id%type;begin insert into persons ( id, first_name, last_name, address, ...)  values  ( nvl(:new.id, central_seq.nextval),:new.first_name   , :new.last_name, :new.address, ...)  returning id into l_psn_id;  insert into user_accounts  ( id, psn_id, username, password)  values  ( central_seq.nextval ,l_psn_id , :new.username   , :new.password);
Instead of Insert Trigger on USERS_VW (2/2)...   insert into email_addresses  ( id, psn_id, ete_id, address)  values  ( central_seq.nextval  , l_psn_id  , ( select id       from   email_types ete       where  ete.address_type = :new.primary_email_type    )  , :new.primary_email)  ;end handle_insert_users_trg;
Creating a new userUser AdministrationUSERSFirst NameLast NameMollyWarholUsernamePasswordmwarhol******USERSEMAIL_TYPEInstead Of DML triggerAddressCity1 SlickroadLas VegasTelephoneMobile555121243219876*EmailEmail typemw@un.orgBusinessPERSONSEMAIL_ADDRESSESActivation24-may-2008**
ADF BC and Complex Views with Instead of TriggersOverride the lock method in the ViewObjectImplDefault implementation will attempt select … from <view> for update ofWhich is not allowed on Views with an instead of trigger
Do not do it…More often than requiredSave on network trips, context switches and tiers to crossSave on ‘reproducing’ same resultsWeb BrowserJS data (memory)
Cookies
 HTML 5 dbEdge CacheJEE Application ServerCacheCluster Fail-Over(Session State)Result StoreWrite BehindClient Result CacheRDBMSResult CacheMaterialized View
The Hollywood Principle: Query ResultSet Change NotificationPOJO / ADF BC
Cache Refresh triggered by DBOracle RDBMS invokes Java Listener with event detailsPOJO / ADF BCRegister DatabaseChangeNotificationSQL queryPL/SQL
Shared Application ModulesNormal Application Module instances are session level – i.e. not shared across (web) sessionsShared Application Module instances are shared across sessions like an Application Scope Managed BeanUsed for Static Data Sets: Look Up Data and Reference TablesSessions can reuse the data from a shared Application Module without having to access the databaseAnd loading the same data in session level memory scopeView Accessors can be used to access data in the Shared Application Module’s VOsFor example for use in LOVs or Validation Rules
Shared Application Module Instance
Auto Refresh for ViewObjectsViewObjects in a Shared Application Module can be registered for auto refreshTypically such application wide VOs are near-staticWhenever the underlying data set changes (in the database), the VO rowset should be refreshedBy setting Auto Refresh (to true) for the ViewObject, the VO will be refreshed whenever the database is changedADF registers the VO query with the Database (11g) Result Set Change Notification mechanism through JDBCNote: the VO should not have an Order By clause nor select a Date column
Steps for auto refresh enablingCreate Shared Application ModuleNew application module that is added to list of Application Level instances in the Project propertiesCreate the ViewObject that queries the ‘static data’ and add to Shared Application ModuleSet the Auto Refresh property to true for VO instanceDatabase must be 11g (and have parameter compatible set to 11.1.0 or above)database user must have the Change Notification privilegeTo piggyback changes to page, set changeEventPolicy to autoPPR on data binding
Set Auto Refresh for ViewObjectSet Auto Refresh for ViewObjectGrant Change Notification todatabase user
Ad

More Related Content

What's hot (18)

Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013
BertrandDrouvot
 
U-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningU-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance Tuning
Michael Rys
 
Drill / SQL / Optiq
Drill / SQL / OptiqDrill / SQL / Optiq
Drill / SQL / Optiq
Julian Hyde
 
SQL to Hive Cheat Sheet
SQL to Hive Cheat SheetSQL to Hive Cheat Sheet
SQL to Hive Cheat Sheet
Hortonworks
 
Don't optimize my queries, organize my data!
Don't optimize my queries, organize my data!Don't optimize my queries, organize my data!
Don't optimize my queries, organize my data!
Julian Hyde
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebook
ragho
 
MySQL lecture
MySQL lectureMySQL lecture
MySQL lecture
webhostingguy
 
MS SQL Server
MS SQL ServerMS SQL Server
MS SQL Server
Md. Mahedee Hasan
 
ORACLE BY KMR SOFTWARE SERVICES
ORACLE BY KMR SOFTWARE SERVICESORACLE BY KMR SOFTWARE SERVICES
ORACLE BY KMR SOFTWARE SERVICES
KMR SOFTWARE SERVICES PVT LTD
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
Md.Mojibul Hoque
 
Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!
Julian Hyde
 
9780538745840 ppt ch06
9780538745840 ppt ch069780538745840 ppt ch06
9780538745840 ppt ch06
Terry Yoast
 
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Julian Hyde
 
Sql views
Sql viewsSql views
Sql views
arshid045
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
David Truxall
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
webhostingguy
 
MYSQL
MYSQLMYSQL
MYSQL
Ankush Jain
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
united global soft
 
Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013
BertrandDrouvot
 
U-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance TuningU-SQL Query Execution and Performance Tuning
U-SQL Query Execution and Performance Tuning
Michael Rys
 
Drill / SQL / Optiq
Drill / SQL / OptiqDrill / SQL / Optiq
Drill / SQL / Optiq
Julian Hyde
 
SQL to Hive Cheat Sheet
SQL to Hive Cheat SheetSQL to Hive Cheat Sheet
SQL to Hive Cheat Sheet
Hortonworks
 
Don't optimize my queries, organize my data!
Don't optimize my queries, organize my data!Don't optimize my queries, organize my data!
Don't optimize my queries, organize my data!
Julian Hyde
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebook
ragho
 
Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!
Julian Hyde
 
9780538745840 ppt ch06
9780538745840 ppt ch069780538745840 ppt ch06
9780538745840 ppt ch06
Terry Yoast
 
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Julian Hyde
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
David Truxall
 

Similar to Odtug2011 adf developers make the database work for you (20)

Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
Lucas Jellema
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
Marcus Davage
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas Jellema
Lucas Jellema
 
Database Foundation Training
Database Foundation TrainingDatabase Foundation Training
Database Foundation Training
Franky Lao
 
Practical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationPractical SQL query monitoring and optimization
Practical SQL query monitoring and optimization
Ivo Andreev
 
MyBatis
MyBatisMyBatis
MyBatis
Roman Dovgan
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
avniS
 
Optimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScaleOptimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScale
RightScale
 
Scaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLScaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQL
Jim Mlodgenski
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
KareemBullard1
 
Spark streaming , Spark SQL
Spark streaming , Spark SQLSpark streaming , Spark SQL
Spark streaming , Spark SQL
Yousun Jeong
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations
 
A Practical Enterprise Feature Store on Delta Lake
A Practical Enterprise Feature Store on Delta LakeA Practical Enterprise Feature Store on Delta Lake
A Practical Enterprise Feature Store on Delta Lake
Databricks
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Ontico
 
DP-900.pdf
DP-900.pdfDP-900.pdf
DP-900.pdf
PavanKumarMantha2
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
Jürgen Ambrosi
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
Peter Gfader
 
Powering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraphPowering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraph
ScyllaDB
 
Data access
Data accessData access
Data access
Joshua Yoon
 
Etl05 05
Etl05 05Etl05 05
Etl05 05
kvkumar_2001
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
Lucas Jellema
 
MDI Training DB2 Course
MDI Training DB2 CourseMDI Training DB2 Course
MDI Training DB2 Course
Marcus Davage
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas Jellema
Lucas Jellema
 
Database Foundation Training
Database Foundation TrainingDatabase Foundation Training
Database Foundation Training
Franky Lao
 
Practical SQL query monitoring and optimization
Practical SQL query monitoring and optimizationPractical SQL query monitoring and optimization
Practical SQL query monitoring and optimization
Ivo Andreev
 
Overview of query evaluation
Overview of query evaluationOverview of query evaluation
Overview of query evaluation
avniS
 
Optimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScaleOptimizing Your Cloud Applications in RightScale
Optimizing Your Cloud Applications in RightScale
RightScale
 
Scaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLScaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQL
Jim Mlodgenski
 
05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx05_DP_300T00A_Optimize.pptx
05_DP_300T00A_Optimize.pptx
KareemBullard1
 
Spark streaming , Spark SQL
Spark streaming , Spark SQLSpark streaming , Spark SQL
Spark streaming , Spark SQL
Yousun Jeong
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations
 
A Practical Enterprise Feature Store on Delta Lake
A Practical Enterprise Feature Store on Delta LakeA Practical Enterprise Feature Store on Delta Lake
A Practical Enterprise Feature Store on Delta Lake
Databricks
 
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Inexpensive Datamasking for MySQL with ProxySQL — Data Anonymization for Deve...
Ontico
 
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
2° Ciclo Microsoft CRUI 3° Sessione: l'evoluzione delle piattaforme tecnologi...
Jürgen Ambrosi
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
Peter Gfader
 
Powering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraphPowering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraph
ScyllaDB
 
Ad

More from Luc Bors (20)

Talk to me Goose: Going beyond your regular Chatbot
Talk to me Goose: Going beyond your regular ChatbotTalk to me Goose: Going beyond your regular Chatbot
Talk to me Goose: Going beyond your regular Chatbot
Luc Bors
 
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development KitExtending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
Luc Bors
 
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud ServiceNO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
Luc Bors
 
Real Life MAF (2.2) Oracle Open World 2015
Real Life MAF (2.2) Oracle Open World 2015Real Life MAF (2.2) Oracle Open World 2015
Real Life MAF (2.2) Oracle Open World 2015
Luc Bors
 
Real life-maf-2015-k scope-final
Real life-maf-2015-k scope-finalReal life-maf-2015-k scope-final
Real life-maf-2015-k scope-final
Luc Bors
 
Real life-maf-2015
Real life-maf-2015Real life-maf-2015
Real life-maf-2015
Luc Bors
 
ADF Essentials (KScope14)
ADF Essentials (KScope14)ADF Essentials (KScope14)
ADF Essentials (KScope14)
Luc Bors
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
Luc Bors
 
OgH Data Visualization Special Part III
OgH Data Visualization Special Part IIIOgH Data Visualization Special Part III
OgH Data Visualization Special Part III
Luc Bors
 
OgH Data Visualization Special Part II
OgH Data Visualization Special Part IIOgH Data Visualization Special Part II
OgH Data Visualization Special Part II
Luc Bors
 
OgH Data Visualization Special Part I
OgH Data Visualization Special Part IOgH Data Visualization Special Part I
OgH Data Visualization Special Part I
Luc Bors
 
MAF push notifications
MAF push notificationsMAF push notifications
MAF push notifications
Luc Bors
 
Doag wysiwyg
Doag wysiwygDoag wysiwyg
Doag wysiwyg
Luc Bors
 
amis-adf-enterprise-mobility
amis-adf-enterprise-mobilityamis-adf-enterprise-mobility
amis-adf-enterprise-mobility
Luc Bors
 
Oracle day 2014-mobile-customer-case
Oracle day 2014-mobile-customer-caseOracle day 2014-mobile-customer-case
Oracle day 2014-mobile-customer-case
Luc Bors
 
Oracle MAF real life OOW.pptx
Oracle MAF real life OOW.pptxOracle MAF real life OOW.pptx
Oracle MAF real life OOW.pptx
Luc Bors
 
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
Luc Bors
 
ADF Mobile: 10 Things you don't get from the developers guide
ADF Mobile: 10 Things you don't get from the developers guideADF Mobile: 10 Things you don't get from the developers guide
ADF Mobile: 10 Things you don't get from the developers guide
Luc Bors
 
oow2013-adf-mo-bi-le
oow2013-adf-mo-bi-leoow2013-adf-mo-bi-le
oow2013-adf-mo-bi-le
Luc Bors
 
Goodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating LayoutsGoodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating Layouts
Luc Bors
 
Talk to me Goose: Going beyond your regular Chatbot
Talk to me Goose: Going beyond your regular ChatbotTalk to me Goose: Going beyond your regular Chatbot
Talk to me Goose: Going beyond your regular Chatbot
Luc Bors
 
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development KitExtending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
Extending Oracle SaaS Using Oracle Cloud UX Rapid Development Kit
Luc Bors
 
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud ServiceNO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
NO CODE : Or How to Extend Oracle SaaS with Oracle Visual Builder Cloud Service
Luc Bors
 
Real Life MAF (2.2) Oracle Open World 2015
Real Life MAF (2.2) Oracle Open World 2015Real Life MAF (2.2) Oracle Open World 2015
Real Life MAF (2.2) Oracle Open World 2015
Luc Bors
 
Real life-maf-2015-k scope-final
Real life-maf-2015-k scope-finalReal life-maf-2015-k scope-final
Real life-maf-2015-k scope-final
Luc Bors
 
Real life-maf-2015
Real life-maf-2015Real life-maf-2015
Real life-maf-2015
Luc Bors
 
ADF Essentials (KScope14)
ADF Essentials (KScope14)ADF Essentials (KScope14)
ADF Essentials (KScope14)
Luc Bors
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
Luc Bors
 
OgH Data Visualization Special Part III
OgH Data Visualization Special Part IIIOgH Data Visualization Special Part III
OgH Data Visualization Special Part III
Luc Bors
 
OgH Data Visualization Special Part II
OgH Data Visualization Special Part IIOgH Data Visualization Special Part II
OgH Data Visualization Special Part II
Luc Bors
 
OgH Data Visualization Special Part I
OgH Data Visualization Special Part IOgH Data Visualization Special Part I
OgH Data Visualization Special Part I
Luc Bors
 
MAF push notifications
MAF push notificationsMAF push notifications
MAF push notifications
Luc Bors
 
Doag wysiwyg
Doag wysiwygDoag wysiwyg
Doag wysiwyg
Luc Bors
 
amis-adf-enterprise-mobility
amis-adf-enterprise-mobilityamis-adf-enterprise-mobility
amis-adf-enterprise-mobility
Luc Bors
 
Oracle day 2014-mobile-customer-case
Oracle day 2014-mobile-customer-caseOracle day 2014-mobile-customer-case
Oracle day 2014-mobile-customer-case
Luc Bors
 
Oracle MAF real life OOW.pptx
Oracle MAF real life OOW.pptxOracle MAF real life OOW.pptx
Oracle MAF real life OOW.pptx
Luc Bors
 
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
Luc Bors
 
ADF Mobile: 10 Things you don't get from the developers guide
ADF Mobile: 10 Things you don't get from the developers guideADF Mobile: 10 Things you don't get from the developers guide
ADF Mobile: 10 Things you don't get from the developers guide
Luc Bors
 
oow2013-adf-mo-bi-le
oow2013-adf-mo-bi-leoow2013-adf-mo-bi-le
oow2013-adf-mo-bi-le
Luc Bors
 
Goodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating LayoutsGoodbye Nightmare : Tops and Tricks for creating Layouts
Goodbye Nightmare : Tops and Tricks for creating Layouts
Luc Bors
 
Ad

Recently uploaded (20)

Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 

Odtug2011 adf developers make the database work for you

  • 1. ADF Developers – make the database work for youODTUG Kaleidoscope 2011 – Long Beach, CaliforniaLuc Bors, AMIS, The Netherlands
  • 2. DesktopBrowser-BasedMetadata Services (MDS)Oracle ADF – Role of the DatabaseJSFJSPOfficeADFSwingMobileViewADF Faces JSFStrutsADF ControllerControllerADF BindingModelBusiness ServicesEJBBAMADFbcPortletsBIBPELWeb ServicesJavaData ServicesDatabaseWeb ServicesLegacy SystemsApps Unlimited
  • 3. “We could also do that in the database”in the database? Huh?RDBMS≈
  • 4. Design & team that combines strengths of all technologies…Ease and Elegance of Implementation
  • 5. Functionality (in an affordable way)
  • 7. PerformanceADF Controller/ADF FacesADF ModelADF BC/JPA/WS*Oracle RDBMS
  • 8. Database StrengthsIntegrityFine grained (data) security and auditingData Retrieval joining tables together, leveraging indexeshierarchical, network-like traversals advanced analytics, historical queries, mining Aggregation and SortingComplex & Massive Data Manipulation
  • 9. RDBMS not always exclusively accessed through one Java APISOA, ESB, WebServicesDatabaseBatch Bulk ProcessesStandard ApplicationsLegacyApplicationsData Replication & Synchronization
  • 10. Database Triggers – decorating Data ManipulationTriggers execute before or after Insert, Update or Delete of database recordsinsert, update, deleteBefore Insert trigger: sal=…Employees
  • 11. Purpose of triggersSet default values on new recordsif :new.job=‘SALESMAN’ then :new.comm = 1000Calculate & Derive values upon insert, update or deleteNotify third parties of data manipulationPerform complex validation on the data changes applied by the transactionPer Department: Max Salary < 1.8 * AveragePer Manager: #subordinates < 15
  • 12. ADF BC refreshing Entity Objects after triggers have applied new valuesEntity Object Employee(leveraging: returning <column> into : bind)postBefore Insert trigger: sal=…Employees
  • 13. Aggregation & RollupData for reporting purposes can be prepared by database queriesIncluding aggregations(max/min/avg/count/sum)and Sub Totals and Grand Totaland String Aggregation
  • 14. Dynamic Aggregation through Non-conventional use of bind parametersBind parameters are typically used in the WHERE clause of a SQL queryHowever: they can also be used in the SELECT, ORDER BY and GROUP BY sectionsA combination of CASE and bind parameters in the GROUP BY can provide interesting optionsDynamicAggregation
  • 15. Query for dynamic aggregation
  • 16. Sub and Grandtotals with RollupRollup instructs databaseto aggregate at every levelstarting from the rightdeptno, jobdeptno(grand total)Also see:CubeGroupingSets
  • 17. Leveraging SQL Aggregation to make life easier for the UI developer
  • 18. Analytical Functions – spreadsheet-style row processingAnalytical Functions allow SQL queries to perform inter-row comparison & aggregationFor example: in a single query, for each employeeshow salary rank in department and jobshow salary difference with colleague next higher in rank (on the list per department)show average salary in the departmentshow csv list of colleagues in department
  • 20. Flashback Queryselect emp.*, dept.dnamefrom emp AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' DAY) , deptwhere emp.deptno = dept.deptno
  • 21. Show historic situation for selected records
  • 22. Flashback VersionsRetrieve all states each record has been inEvery transaction that touched a row left a version of the recordPseudocolumns: xid, operation, start time, end timeUse constants minvalueand maxvalueto retrieve all versionsFlashback versions make journaling tables redundant
  • 24. Show change history for a record based on Flashback versions
  • 25. Embedding Historic Data in ADF ApplicationWhere Clause in (read only) ViewObject can include FLASHBACK operatorsAS OF and VERSIONS BETWEENBind parameters can be used to set the point in time or the historic time intervalA time selector can be used to visually set the intervalScalar subqueries can be used for ‘in line comparison to a certain point in time’“How much higher/lower is the salary than at the selected date?”
  • 26. Trees
  • 27. Trees
  • 28. ADF Model & Tree Data BindingCreate hierarchical relation between multiple ViewObject or (POJO) Collection BindingsTree Data Retrieval retrieves collections in several steps i.e. multiple queriesData is cachedData is only queried when required (given the expansion level of the tree)Alternatively: have the database do the heavy tree lifting: Database has optimized tree algorithmsStarting at any node in the tree or networkDrilling down to the specified number of levelsOrder siblings within parentIndicate leaf and parent nodes; detect cycles
  • 29. Retrieving Hierarchical data sets with single SQL statementsDatabase has optimized algorithmsStarting at any node in the tree or networkDrilling down to the specified number of levelsOrder siblings within parentIndicate leaf and parent nodes; detect cyclesEMPID ENAME MGR DEPTNO LEVEL--------------- ---------- ---------- ---------- ---------- 7839 KING 10 1 7698 BLAKE 7839 30 2 7499 ALLEN 7698 30 3 7900 JAMES 7698 30 3 7654 MARTIN 7698 30 3 7844 TURNER 7698 30 3 7521 WARD 7698 30 3 7782 CLARK 7839 10 2 7934 MILLER 7782 10 3
  • 30. Oracle 11g and ANSI SQL for hierarchical querywith employees (empno, name, mgr, hierlevel, path) as ( select empno, ename, mgr, 1, ename from emp where mgr is null union all select e.empno, e.ename , e.mgr, m.hierlevel + 1 , m.path||'/'||e.ename from emp e join employees m on (m.empno = e.mgr) )select *from employees
  • 32. Steps for filter driven queryingDetermine the values to filter onCreate a query to retrieve for all filtersEvery individual value and the # occurrencesThe where-clause to apply on the real VOThe label for the filterCreate a managed bean to apply selected filtersto ViewObjectCreate page that displays filters and selected dataand handles filter “clicks”
  • 33. Encapsulate Database specific SQL in a View APIViews – for encapsulation of data model, multi-table join, (advanced) SQL hiding, authorization rulesNote: a view looks like a table to the clientView
  • 34. The read-only cursor APIA Cursor is a reference to a query result setDatabase can open a cursor for a SQL queryAnd return it to the application to fetch the rows fromCursor == JDBCResultSetA cursor can be nested: containdetails … JDBC ResultSetwhile rs.next { … }cursorStored ProcedureDepartmentsSQLEmployees
  • 35. Cursor for Master-Detail resultsetStored Procedure
  • 36. Using Complex Views for Hiding Legacy Data Models
  • 37. Providing a ‘business object’ APIDML API: a View – aided by an Instead Of triggerInsert of one new row inUSERS_VW (e.g. a JPApersist operation) can actually be four new recordsUSER, PERSON, EMAIL_TYPEEMAIL_ADDRESSUSERSUSERSEMAIL_TYPEInstead Of DML trigger**PERSONSEMAIL_ADDRESSES**
  • 38. Instead of Insert Trigger on USERS_VW (1/2)create or replace trigger handle_insert_users_trginstead of insert on users_vwfor each row declare l_psn_id persons.id%type;begin insert into persons ( id, first_name, last_name, address, ...) values ( nvl(:new.id, central_seq.nextval),:new.first_name , :new.last_name, :new.address, ...) returning id into l_psn_id; insert into user_accounts ( id, psn_id, username, password) values ( central_seq.nextval ,l_psn_id , :new.username , :new.password);
  • 39. Instead of Insert Trigger on USERS_VW (2/2)... insert into email_addresses ( id, psn_id, ete_id, address) values ( central_seq.nextval , l_psn_id , ( select id from email_types ete where ete.address_type = :new.primary_email_type ) , :new.primary_email) ;end handle_insert_users_trg;
  • 40. Creating a new userUser AdministrationUSERSFirst NameLast NameMollyWarholUsernamePasswordmwarhol******USERSEMAIL_TYPEInstead Of DML triggerAddressCity1 SlickroadLas VegasTelephoneMobile555121243219876*EmailEmail [email protected]_ADDRESSESActivation24-may-2008**
  • 41. ADF BC and Complex Views with Instead of TriggersOverride the lock method in the ViewObjectImplDefault implementation will attempt select … from <view> for update ofWhich is not allowed on Views with an instead of trigger
  • 42. Do not do it…More often than requiredSave on network trips, context switches and tiers to crossSave on ‘reproducing’ same resultsWeb BrowserJS data (memory)
  • 44. HTML 5 dbEdge CacheJEE Application ServerCacheCluster Fail-Over(Session State)Result StoreWrite BehindClient Result CacheRDBMSResult CacheMaterialized View
  • 45. The Hollywood Principle: Query ResultSet Change NotificationPOJO / ADF BC
  • 46. Cache Refresh triggered by DBOracle RDBMS invokes Java Listener with event detailsPOJO / ADF BCRegister DatabaseChangeNotificationSQL queryPL/SQL
  • 47. Shared Application ModulesNormal Application Module instances are session level – i.e. not shared across (web) sessionsShared Application Module instances are shared across sessions like an Application Scope Managed BeanUsed for Static Data Sets: Look Up Data and Reference TablesSessions can reuse the data from a shared Application Module without having to access the databaseAnd loading the same data in session level memory scopeView Accessors can be used to access data in the Shared Application Module’s VOsFor example for use in LOVs or Validation Rules
  • 49. Auto Refresh for ViewObjectsViewObjects in a Shared Application Module can be registered for auto refreshTypically such application wide VOs are near-staticWhenever the underlying data set changes (in the database), the VO rowset should be refreshedBy setting Auto Refresh (to true) for the ViewObject, the VO will be refreshed whenever the database is changedADF registers the VO query with the Database (11g) Result Set Change Notification mechanism through JDBCNote: the VO should not have an Order By clause nor select a Date column
  • 50. Steps for auto refresh enablingCreate Shared Application ModuleNew application module that is added to list of Application Level instances in the Project propertiesCreate the ViewObject that queries the ‘static data’ and add to Shared Application ModuleSet the Auto Refresh property to true for VO instanceDatabase must be 11g (and have parameter compatible set to 11.1.0 or above)database user must have the Change Notification privilegeTo piggyback changes to page, set changeEventPolicy to autoPPR on data binding
  • 51. Set Auto Refresh for ViewObjectSet Auto Refresh for ViewObjectGrant Change Notification todatabase user
  • 53. Reaching out from the databaseDatabase
  • 55. Database receiving and sending emails – from people or applications
  • 58. JEE Application ServerEnterprise Service BusADF ApplicationWeb Service?Database informing and leveraging the middle tierHTTP calls using the UTL_HTTP package
  • 59. Asynchronous processingExecute stored procedures or command scripts (O/S) in the background – using a jobFree up the synchronous threadReturn control to invoking Java applicationIdeal for Fire-and-Forget (one way) callsResults can be returned asynchronouslyVia Queue, Table, Database Query Result Change Notification, HTTP call, Email,…Create a Job in the Oracle Database using:package dbms_scheduler
  • 60. Other Database Features worth investigating Virtual Private Database & Fine Grained AuthorizationXMLType, XMLDB & FTP/HTTP/WEBDAV serverObject Types and CollectionsData type Interval & Time Zone supportFine Grained AuditingSystem Triggers, for example “after logon”(Global) Application ContextAutonomous TransactionAdvanced Queuing (& JMS interaction)Creating advanced job execution schedulesEdition Based Redefinition (versioning of database objects)Statistics and Data MiningScalar Subqueries
  • 61. Summary & ConclusionsDatabases can do much more thanADF applications can benefit!Strike the right balance:Leverage database forwhat it can do bestMake ADF and Database work together in a smooth way

Editor's Notes

  • #2: Process
  • #12: http://technology.amis.nl/blog/4162/dynamic-and-conditional-grouping-in-sql-queries-for-flexible-results-from-single-query-oh-and-a-useful-case-for-the-cube-operator
  • #15: http://technology.amis.nl/blog/4191/adf-11g-treetable-with-sub-totals-how-the-sql-query-can-make-life-easier-for-the-view-developer
  • #17: select ename, sal, deptno, job, rank() over (partition by deptno order by saldesc) sal_rank_in_dept, rank() over (partition by job order by saldesc) sal_rank_in_job, lag(sal,1) over (partition by deptno order by saldesc) diff_with_next_higher_in_dept, listagg(ename, &apos;,&apos;) within group (order by ename) over (partition by deptno) colleaguesfrom emporderby deptno, saldesc
  • #23: http://technology.amis.nl/blog/3255/integrating-flashback-in-adf-web-applications-providing-the-historic-perspectivehttp://technology.amis.nl/documents/technology/dvt.pdf
  • #40: Cache – spreekuit: kasjeKastjesBrowser: Client (browser, cookie or Java Script memory; HTML 5 offers persistent, cross session local db like storage)App Server : Edge (WebServer)JVM (and cluster)Cross cluster shared cachedb or memory gridDatabase (not requery at least)
  • #51: Screenshot:Frank sends email to Maggie – with a query on EmployeesAfter some time, a response is sent to this particular email – by the queue listener using the JSP to send(list of employee data, corresponding with “query”)