JBoss at Work Databases and JBoss Chapter 4 Jeff Schmitt October 26, 2006.

Slides:



Advertisements
Similar presentations
Introduction to the Spring Framework
Advertisements

An Object/Relational Mapping tool Free and open source Simplifies storage of object data in a relational database Removes the need to write and maintain.
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Spring, Hibernate and Web Services 13 th September 2014.
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
Approaches to EJB Replication. Overview J2EE architecture –EJB, components, services Replication –Clustering, container, application Conclusions –Advantages.
An architecture for webb applications, J2EE
Layered Architectures The objectives of this chapter are: To understand the principles and importance of Layered Architectures To explain the structure.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
July 23 th, 2005 Software Architecture in Practice RiSE’s Seminars Bass’s et al. Book :: Chapter 16 Fred Durão.
ORM Object-Relational Mapping 1. Object Persistence Persistence is the ability of an object to survive the lifecycle of the process, in which it resides.
Session-01. Hibernate Framework ? Why we use Hibernate ?
Emmanuel Cecchet et al.  Performance Scalability of J2EE application servers.  Test effect of: ◦ Application Implementation Methods ◦ Container Design.
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
Data Persistence and Object-Relational Mapping Slides by James Brucker, used with his permission 1.
Data Access Patterns. Motivation Most software systems require persistent data (i.e. data that persists between program executions). In general, distributing.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
IMS Technical Conference IMS Java Remote Database Services Kyle Charlet.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
Ing. Ignacio Roqueta ARTech GeneXus and J2EE.
Entity Beans BMP Celsina Bignoli
Middleware Technology (J2EE/EJB) Entity Bean. 2 Introduction to Entity Beans Persistence Concepts Entity beans are persistent objects that can be stored.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
Entity Java Beans Jorg Janke Open Source ERP & CRM.
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
Enterprise Java Bean Matt. 2 J2EE 3 J2EE Overview.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
Fundamentals of Database Chapter 7 Database Technologies.
Spring Framework. Spring Overview Spring is an open source layered Java/J2EE application framework Created by Rod Johnson Based on book “Expert one-on-one.
Spring Data Access By, Srinivas Reddy.S
JBoss Overview J2EE Sig Presenter: Steve Davidson Stephen Davidson & Associates, INC.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 14 Using Relational Databases to Provide Object Persistence (Overview) Modern Database.
Spring Database Access Ojitha Kumanayaka Copyright © Virtusa, 2007.
Hibernate Persistence. What is Persistence Persist data to database or other storage.  In OO world, persistence means persist object to external storage.
Hibernate 3.0. What is Hibernate Hibernate is a free, open source Java package that makes it easy to work with relational databases. Hibernate makes it.
Java Database Connectivity (JDBC). Topics 1. The Vendor Variation Problem 2. SQL and Versions of JDBC 3. Creating an ODBC Data Source 4. Simple Database.
JPA / HIBERNATE CSCI 6370 Nilayan Bhattacharya Sanket Sable.
آرمان حسين‌زاده آذر  Access to data varies depending on the source of the data.  Access to persistent storage, such as to a database, varies greatly.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
1 Nov 29, 2005 Object Relational Mapping Frameworks Wiene Höweler.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Introduction – ORM, Helloworld Application
EJB Enterprise Java Beans JAVA Enterprise Edition
EJB. Introduction Enterprise Java Beans is a specification for creating server- side scalable, transactional, multi-user secure enterprise-level applications.
CS422 Principles of Database Systems Object-Relational Mapping (ORM) Chengyu Sun California State University, Los Angeles.
CS520 Web Programming Object-Relational Mapping with Hibernate and JPA (I) Chengyu Sun California State University, Los Angeles.
Hibernate Java Persistence API. What is Persistence Persistence: The continued or prolonged existence of something. Most Applications Achieve Persistence.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
HIBERNATE/Java Overview of technology for Hibernate by محمد حسن کاظمی پوران Master : M.M.Nematollahi.
Database: JDBC Overview
DEPTT. OF COMP. SC & APPLICATIONS
Web Technologies IT230 Dr Mohamed Habib.
Database JDBC Overview CS Programming Languages for Web Applications
Intro to Spring CJUG - January 2013.
Component-based Applications
Understanding and Designing with EJB
Developing and testing enterprise Java applications
Java API for Database Connectivity
Chengyu Sun California State University, Los Angeles
Presentation transcript:

JBoss at Work Databases and JBoss Chapter 4 Jeff Schmitt October 26, 2006

Persistence Tier ORM – Object Relational Mapping Frees the developer from the perils of converting ResultSets to ArrayLists of DTOs Allows the database to be “transparent” (don’t see it) Therefore we call this the Persistence Tier rather than the Database Tier

JDBC According to Sun, not an acronym, but strongly suggests “Java Database Connectivity” An API that loads database drivers, makes connections, create statements, that yield ResultSets upon execution You write the SQL: Insert, Update, Delete, etc. OO purists do not like the thought of dealing with strings and converting to/from objects Violates DRY principle - Don't Repeat Yourself – maintains two representations – Java and SQL

OODBMS Object Oriented DBM systems exist Removes the need to marshal and unmarshal objects Unmarshaling, in data binding terms, refers to the conversion of XML documents to Java object instances. OODBMS are not popular, low market share Relational DB systems are widely accepted -- entrenched

EJB Entity bean Entity beans – two basic variations –BMP – Bean managed persistence –CMP – Container managed persistence Problem with EJB: –Not a simple POJO: you are forced to deal with a variety of complicated and interdependent classes –Objects tightly coupled with container: you are forced to inherit from EJBObject and implement specific intergfaces

JDO Java Data Objects – Sun’s next attempt at a JavaBean-centric persistence API Not an official part of J2EE standard RDBMS vendors slow to support it OODBMS vendors enthusiastically support it Main problem is a complicated API – different from Entity Beans but still complicated

Hibernate ORM JBoss Hibernate – one of the most popular of the ORMs JBoss supports it Seems to best represent what the next generation of persistence API’s will look like Meanwhile Sun is working toward a merger of EJB 3.0 and JDO 2.0 – it may resemble Hibernate (we’ll have to see)

Case Study Chapter 4: JDBC version Chapter 5: Hibernate version Both chapters use a DAO to hide the details of the persistence layer We create a common interface: CarDAO Method: public List findAll()

JDBC Disadvantages Every connection to the db must incur overhead You have to manage the database transaction yourself If you combine DB activity and non-DB such as JMS messages, No way to roll back transactions – this is called a global transaction

DataSource advantages JBoss creates a Connection Pool at startup – when you get or close a database connection, you just access an open connection from the pool Container-managed Transaction Context – commits or rolls back automatically Can participate in a global transaction – if you combine DB activity and JMS messages, Transaction Manager can roll back everything

JNDI – two level names ENC - Environmental Naming Context – highly recommended naming convention for data sources JNDI name begins with java:comp/env web.xml gives a resource-reference name -- local to the EAR (jdbc/JBossAtWorkDS) jboss-web.xml maps the resource-reference to the global JNDI name Source (java:JBossAtWorkDS) We use XDoclet to generate our web.xml file –See ControllerServlet.java

Hypersonic DB Hypersonic completely implemented in Java. Uses JDBC. Ships standard with JBoss A local db where modifications are stored to disk A variation allows hypersonic to run purely in memory (efficient) Can be configured to listen on a TCP port like a database server JCA – J2EE Container Architecture – a standard way for a J2EE container to connect to external datastores See Jaw-ds.xml Place hsqld.jar -- $JBOSS_HOME/server/default/lib – to share across multiple EARs