1 / 13

EJBs +XML + Integrity Constraints

EJBs +XML + Integrity Constraints. Data-Object Modeling and Optimization (DOMO) June 2003 Rajesh Bordawekar, Michael Burke, Mukund Raghavachari , Vivek Sarkar, Oded Shmueli. A Changing Application Environment.

earleneg
Download Presentation

EJBs +XML + Integrity Constraints

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EJBs +XML + Integrity Constraints Data-Object Modeling and Optimization (DOMO) June 2003 Rajesh Bordawekar, Michael Burke, Mukund Raghavachari, Vivek Sarkar, Oded Shmueli

  2. A Changing Application Environment • Frameworks such as Container-Managed Persistence simplify integration of application logic with databases. • Programmer specifies mapping between Java classes and schema declaratively. • Relational databases have integrity constraints. • XML schemas have integrity constraints. • Application logic may have its own integrity constraints. • There is no mechanism for reasoning about constraints on data given a mapping between language types and relational schema. • Applications may fail when seemingly correct updates are rejected by the database. • Domain constraints and referential integrity constraints. • Need to reason about such constraints.

  3. Setting Mapping associates db.X. t and ejb.X.t Mapping db.X. t ejb.X.t XML data T → What can be deduced about db originated values based on the schema? Relational data

  4. EJBs + XML • Current J2EE implementations provide little support for XML data sources. • Goals: • Understand integration of XML and EJBs. • Efficient algorithms for instantiating EJBs from XML data sources. • E.g., Streaming algorithms. • Focus: Mechanisms for ensuring that XML (and relational) integrity constraints are maintained in application logic. • Past Work: • Streaming algorithms for XPath (ICDE 2003).

  5. XML Data Bindings • XML data is “imported” into the application environment. • Often, the data conforms to an XML schema or a DTD. • XML schemas support constraints: domain, uniqueness, key. • These should be related to relational database and application constraints. • Data travels in both directions (“export”).

  6. Plans • Examine data binding formalisms. • Examine XML schema constraints. • Analyze their interplay at the application level: • Support static analysis of programs to determine constraint violations.

  7. Example: Updating a “Record" • EJB Field SAL is updated in an employee record. • SAL is associated with min=10K, max=200K. • Two salary ranges: [10,45], [65,200]. • May check application code to determine possible violations.

  8. Record XML Schema Complex type <complexType name=“employee”/> <attribute name=“empName” type=“eid”/> <attribute name=“deptNum” type=“dnum”/> <attribute name=“salary” type=“empSal””/> </ complexType > Union type <simpleType name=“empSal”> <union memberType=“lowhigh”/> <\simpleType> Restriction <simpleType name=“low”> <restriction base=:integer”> <minInclusive value=“10”/> <maxInclusive value=“45”/> </restriction> </simpleType> <simpleType name=“high”> <restriction base=:integer”> <minInclusive value=“65”/> <maxInclusive value=“200”/> </restriction> </simpleType>

  9. Use Cases • Reading a database record • Writing/Updating a database record • Reading an XML element/attribute • Writing/Updating an XML element/attribute • Assisting CMP/BMP • Assisting CMR

  10. Using Constraint/Type Information • Constraints for the same application may originate in a relational DB, an XML schema, a DTD or other sources. • We therefore need to reason about and manipulate constraints originating in various formalisms. • Analyze program statically and dynamically to verify that constraints are met. • Failure of a check implies update will fail in DB. Success usually provides no definite information. • Much related Dist. DB literature on the subject.

  11. XAOS: XPath Analysis and Optimization for Streaming • Motivation: • XPath lookup is next major bottleneck in XML processing (after parsing) • Streaming access is most efficient mode for memory hierarchies and large documents XML Document Xpath-specific Automaton supports streaming XPath processing for forward and backward axes XML Parser XPath Expression Parsing Events Specialized XPath Processor Xpath-specific Automaton XML Fragments

  12. XAOS Example XPATH expression //y[u]//w[ancestor::z/v] XDAG: Root Root Root(0) Root(0) descendant descendant Y Y Z Z X (1) child descendant descendant child Y(2) Y(2) Y(10) U U W W V V Z(4) U(9) W(3) Z(4) U(9) Z(11) U(13) XML Document V(5) V(5) V(6) V(6) W(7) W(7) W(7) W(7) V(5) V(6) W(7) W(12) Parser + Specialized XPath Processor Xpath-specific Automaton W(8) W(8) W(8) W(8) XPath Matchings in XML Document

  13. XAOS Scalability: Parsing + XPath Execution times Experiments run on 550 MHz Pentium III, w/ 256MB RAM & Linux 2.2

More Related