A JPA Framework for NoSQL Store behind Integrated Collaboration Object Model Eric S. Chan Object Model Architect Oracle Corporation Philip Y Bell Collaboration Architect Oracle corporation Java Persistence API (JPA) • JPA is primarily an object-relational mapping (ORM) persistence framework (JSR-317 for JPA 2.0), based on popular Hibernate and TopLink frameworks • JPA co-exists with two other technologies – Java Data Objects (JDO) to map Java to relational and nonrelational (object-oriented) data stores (JSR-243 for JDO 3.0) – Service Data Objects (SDO) to abstract data in service oriented architecture (SOA) (JSR-235 for Java binding) • A mix of JPA, JDO, and SDO matches Microsoft ADO.NET Entity Framework and Language Integrated Query (LINQ) Why JPA over JDO or SDO? • JPA was developed in part to unify JDO API and the EJB 2.0 Container Managed Persistence (CMP) API. • JDO 3.0 includes interoperability with JPA • SDO is language independent and backend service-oriented • An increasing number of application APIs are based on JPA/JPQL (due to popularity of open source and commercial offerings, including Hibernate, TopLink, and OpenJPA) JPA/JPQL for Not Only SQL • An Extensible White Box Framework JPA/JPQL can support NoSQL data sources – RESTful Services (WebDAV, CalDAV, CardDAV) – Web Services (BPEL, BPEL4People) – Protocols (SMTP, IMAP, XMPP, LDAP) – Java API’s (JDBC, JNDI, Java Mail, JAXB, etc.) – JPA can be a front-end for JDO and SDO Proof of Concept • OpenICOM, a java.net incubation project for Open Integrated Collaboration Platform – http://java.net/projects/open-icom/pages/Home • Leverage Canonical, Integrated, Standardized Object Model – http://docs.oasis-open.org/icom/icomics/v1.0/csprd01/icom-ics-v1.0-csprd01.html • Support connectors for Oracle Beehive Collaboration Server OpenICOM JPA Framework Open Integrated Collaboration Platform • unifies application programming model • integrates disparate domain models – LDAP, JCR, IMAP, SMTP, XMPP, iCalendar, CalDAV, WebDAV, vCard, FOAF, SIOC, Facebook Open Graph, OpenSocial, BPMN, BPEL, BPEL4People, etc. • interoperates with existing protocols/services • lowers the barrier to create collaboration tools that offer seamless user experience with minimal context switching between activities • transforms to/from RDF/OWL representations for Semantic Web Embodiment of Design Patterns • delineation of managed and detached objects • uniqueness of object identity per persistence context • software transaction memory • eager and lazy loading of states • attribute level change tracking • cascade persist, merge • persistence context and second-level caches • object query language OpenICOM Experience • extend white-box JPA/JPQL framework with – pluggable data access connectors for federated data sources – standardized lightweight behavior in POJO classes to maintain one-tomany and many-to-many relationships in persistence cache • support weaker consistency properties and partial availability in partitioned networks • combine single-entity ACID transaction properties with compensating transaction or soft-state eventually consistent transaction properties. • actively maintain large caches of objects in persistence contexts by time-to-live and/or least-recently-used policies • avoid detaching transaction objects from persistence contexts during transaction rollback, undo, or redo References [1] Open Integrated Collaboration Platform http://java.net/projects/openicom [2] OpenICOM: A JPA Framework for Integrated Collaboration Environments, Part 1 http://today.java.net/article/2011/03/21/openicom-jpa-frameworkintegrated-collaboration-environments-part-1 [3] OASIS ICOM Committee Specification Public Review Draft 01 http://docs.oasis-open.org/icom/icom-ics/v1.0/csprd01/icom-ics-v1.0csprd01.html [4] Sample Groovy scripts for OpenICOM API for Oracle Beehive Server http://java.net/projects/openicom/downloads/download/icomGroovy.tar.gz