JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Application Development Guide
search filter icon
search icon

Document Information


Part I Development Tasks and Tools

1.  Setting Up a Development Environment

2.  Class Loaders

3.  Debugging Applications

Part II Developing Applications and Application Components

4.  Securing Applications

5.  Developing Web Services

6.  Using the Java Persistence API

7.  Developing Web Applications

8.  Using Enterprise JavaBeans Technology

9.  Using Container-Managed Persistence

GlassFish Server Support for CMP

CMP Mapping

Mapping Capabilities

The Mapping Deployment Descriptor File

Mapping Considerations

Join Tables and Relationships

Automatic Primary Key Generation

Fixed Length CHAR Primary Keys

Managed Fields

BLOB Support

CLOB Support

Automatic Schema Generation for CMP

Supported Data Types for CMP

Generation Options for CMP

Schema Capture

Automatic Database Schema Capture

Using the capture-schema Utility

Configuring the CMP Resource

Performance-Related Features

Version Column Consistency Checking

To Use Version Consistency

Relationship Prefetching

Read-Only Beans

Default Fetch Group Flags

Configuring Queries for 1.1 Finders

About JDOQL Queries

Query Filter Expression

Query Parameters

Query Variables

JDOQL Examples

Example 1

Example 2

Example 3

CMP Restrictions and Optimizations

Disabling ORDER BY Validation

Setting the Heap Size on DB2

Eager Loading of Field State

Restrictions on Remote Interfaces

PostgreSQL Case Insensitivity

No Support for lock-when-loaded on Sybase

Sybase Finder Limitation

Date and Time Fields


MySQL Database Restrictions

10.  Developing Java Clients

11.  Developing Connectors

12.  Developing Lifecycle Listeners

13.  Developing OSGi-enabled Java EE Applications

Part III Using Services and APIs

14.  Using the JDBC API for Database Access

15.  Using the Transaction Service

16.  Using the Java Naming and Directory Interface

17.  Using the Java Message Service

18.  Using the JavaMail API


Configuring the CMP Resource

An EJB module that contains CMP beans requires the JNDI name of a JDBC resource in the jndi-name subelement of the cmp-resource element in the glassfish-ejb-jar.xml file. Set PersistenceManagerFactory properties as properties of the cmp-resource element in the glassfish-ejb-jar.xml file. See cmp-resource in Oracle GlassFish Server 3.1 Application Deployment Guide.

In the Administration Console, open the Resources component, then select JDBC. Click the Help button in the Administration Console for information on creating a new JDBC resource.

For a list of the JDBC drivers currently supported by the GlassFish Server, see the Oracle GlassFish Server 3.1-3.1.1 Release Notes. For configurations of supported and other drivers, see Configuration Specifics for JDBC Drivers in Oracle GlassFish Server 3.1 Administration Guide.

For example, if the JDBC resource has the JNDI name jdbc/MyDatabase, set the CMP resource in the glassfish-ejb-jar.xml file as follows: