Feed aggregator

Will the Optimizer Team be at Oracle Open World 2009?

Oracle Optimizer Team - Thu, 2009-07-23 20:18
With only two and a half months to go until Oracle Open World in San Francisco, October 11-15th, we have gotten several requests asking if we plan to present any session at the conference.

We have two session and a demo station in the Database campground at this year's show. We will give a technical presentation on What to Expect from the Oracle Optimizer When Upgrading to Oracle Database 11g and the Oracle Optimizer Roundtable.

The technical session, which is on Tuesday Oct 13 at 2:30 pm, gives step by step instructions and detailed examples of how to use the new 11g features to ensure your upgrade goes smoothly and without any SQL plan regressions.

The roundtable, which is on Thursday Oct. 15th at 10:30 am, will give you a first hand opportunity to pose you burning Optimizer and statistics questions directly to a panel of our leading Optimizer developers. In fact if you plan to attend the roundtable and already know what questions you would like to ask, then please send them to us via email and we will be sure to include them. Other wise, you can hand in your questions at our demo station at any stage during the week, or as you enter the actual session. Just be sure to write your questions in clear block capitals!

We look forward to seeing you all at Oracle Open World.

Will the Optimizer Team be at Oracle Open World 2009?

Inside the Oracle Optimizer - Thu, 2009-07-23 20:18
With only two and a half months to go until Oracle Open World in San Francisco, October 11-15th, we have gotten several requests asking if we plan to present any session at the conference.

We have two session and a demo station in the Database campground at this year's show. We will give a technical presentation on What to Expect from the Oracle Optimizer When Upgrading to Oracle Database 11g and the Oracle Optimizer Roundtable.

The technical session, which is on Tuesday Oct 13 at 2:30 pm, gives step by step instructions and detailed examples of how to use the new 11g features to ensure your upgrade goes smoothly and without any SQL plan regressions.

The roundtable, which is on Thursday Oct. 15th at 10:30 am, will give you a first hand opportunity to pose you burning Optimizer and statistics questions directly to a panel of our leading Optimizer developers. In fact if you plan to attend the roundtable and already know what questions you would like to ask, then please send them to us via email and we will be sure to include them. Other wise, you can hand in your questions at our demo station at any stage during the week, or as you enter the actual session. Just be sure to write your questions in clear block capitals!

We look forward to seeing you all at Oracle Open World.

Categories: DBA Blogs, Development

Initial version of DataMapper Oracle adapter

Raimonds Simanovskis - Mon, 2009-07-20 16:00

datamapper.jpgWhat is DataMapper?

DataMapper is Ruby Object/Relational Mapper that is similar to ActiveRecord (component of Ruby on Rails) but still it handles several things differently than ActiveRecord.

I got interested in DataMapper because I liked better some of its design decisions when compared with ActiveRecord. And in particular DataMapper architecture can suite better if you need to work with legacy Oracle database schemas – that is the area where I use Ruby on Rails a lot and for these purposes I also created Oracle enhanced adapter for ActiveRecord.

But as there were no Oracle adapter available for DataMapper I needed to create one :) I started to work on Oracle adapter for DataMapper after the RailsConf and now it is passing all DataMapper tests on all Ruby platforms – MRI 1.8, Ruby 1.9 and JRuby 1.3.

Why DataMapper for Oracle database?

If you would like to learn main differences between DataMapper and ActiveRecord then please start with this overview and this summary of benefits.

Here I will mention specific benefits if you would like to use DataMapper with Oracle database.

Model properties

In DataMapper you always specify in model class definition what Ruby “type” you would like to use for each model attribute (or property as called in DataMapper):

class Post
  include DataMapper::Resource
  property :id,         Serial
  property :title,      String
  property :post_date,  Date
  property :created_at, DateTime
  property :updated_at, Time

The main benefit for that is that you can explicitly define when to use Ruby Time, Date or DateTime class which is stored as DATE (or sometimes as TIMESTAMP) in Oracle database. In addition you can define your own custom DataMapper types and define how to serialize them into database.

Composite primary keys

DataMapper core library supports composite primary keys for models. If you use ActiveRecord then there is an option to use additional composite_primary_keys gem but it regularly breaks with latest ActiveRecord versions and quite often it also might break in some edge cases. In DataMapper composite primary keys are defined quite simple:

class City
  include DataMapper::Resource
  property :country,   String, :key => true
  property :name,      String, :key => true
Legacy schemas

DataMapper is quite useful when you want to put Ruby models on top of existing Oracle schemas. It is possible to provide different database field name for property or provide custom sequence name for primary keys:

class Post
  include DataMapper::Resource
  property :id, Serial, :field => "post_id", :sequence => "post_s"  

You can also define one model that can be persisted in two different repositories (e.g. databases or schemas) and use different naming conventions in each repository:

class Post
  include DataMapper::Resource
  repository(:old) do
    property :id, Serial, :field => "post_id", :sequence => "post_s"
  repository(:default) do
    property :id, Serial

As a result DataMapper can be used also for data migration between different databases.

Bind variables

ActiveRecord always generates SQL statements for execution as one single string. Therefore Oracle enhanced adapter always initializes Oracle session with setting cursor_sharing=‘similar’. It instructs Oracle always to take all literals (constants) from SQL statement and replace them with bind variables. It reduces the number of unique SQL statements generated but also it is some overhead for Oracle optimizer.

DataMapper always passes all statement parameters separately to corresponding database adapter and therefore it is possible for Oracle adapter to pass all parameters as bind variables to Oracle.

CLOB and BLOB values inserting and selecting

As for ActiveRecord all inserted values should be passed as literals in INSERT statement it was not possible to insert large CLOB and BLOB values directly in INSERT statement. Therefore ActiveRecord Oracle enhanced adapter did separate call-backs for inserting any CLOB or BLOB data after INSERT of other data. In DataMapper it is possible to insert all data at once as CLOB and BLOB data are passed as bind variables.

DataMapper also handles better lazy loading of large columns. So if you define property as Text then by default it will not be selected from database – it will be selected separately only when you use it. Typically it could reduce amount of data that needs to be sent from database to application as Text properties are quite often not needed in e.g. all web pages.

Wny not DataMapper?

If you are fine with ActiveRecord default conventions and you don’t have any issues that I listed previously then probably ActiveRecord is good enough for you and you shouldn’t change to DataMapper. There are of course much more Rails plugins that work with ActiveRecord but not yet with DataMapper. And DataMapper is still much less used and therefore there might some edge cases where it is not tested and you will need to find the issue causes by yourself.

But if you like to try new things then please try it out – and also DataMapper community is quite friendly and helpful and will help to solve any issues :)

Installation of DataMapper Oracle adapter

So if you have decided to try to use DataMapper with Oracle database then follow the instructions how to install it.

Oracle support is done for current development version 0.10.0 of DataMapper – therefore you will need to install the latest versions from GitHub (they are still not published as gems on RubyForge).

DataMapper with Oracle adapter can be used both on MRI 1.8.6 (I am not testing it on 1.8.7) and Ruby 1.9.1 as well as on JRuby 1.3. And currently installation is tested on Mac OS X and Linux – if there is anyone interested in Windows support then please let me know.

MRI 1.8.6 or Ruby 1.9.1

At first you need to have the same preconditions as for ActiveRecord:

  • Oracle Instant Cient
  • ruby-oci8 gem, version 2.0.2 or later

If you are using Mac then you can use these instructions for installation.

Now at first it is necessary to install DataObjects Oracle driver – DataObjects library is unified interface to relational databases (like SQLite, MySQL, PostgreSQL, Oracle) that DataMapper uses to access these databases.

At first validate that you have the latest version of rubygems installed and install necessary additional gems:

gem update --system
gem install addressable -v 2.0

As I mentioned currently you need to install the latest version from GitHub (at first create and go to directory where you would like to store DataMapper sources):

git clone git://github.com/datamapper/extlib.git
cd extlib
git checkout -b next --track origin/next
rake install
cd ..
git clone git://github.com/datamapper/do.git
cd do
git checkout -b next --track origin/next
cd data_objects
rake install
cd ../do_oracle
rake compile
rake install
cd ../..

Now if DataObjects installation was successful you can install DataMapper. UPDATE: Oracle adapter is now in “next” branch of DataMapper so now you need to install it form there:

git clone git://github.com/datamapper/dm-core.git
cd dm-core
git checkout -b next --track origin/next
rake install

Now start irb and test if you can connect to Oracle database (change database name, username and password according to your setup):

require "rubygems"
require "dm-core"
DataMapper.setup :default, "oracle://hr:hr@xe"

and try some basic DataMapper operations (I assume that you don’t have posts table in this schema):

class Post
  include DataMapper::Resource
  property :id,     Serial, :sequence => "posts_seq"
  property :title,  String
p = Post.create(:title=>"Title")

At first I assume that you have already installed JRuby latest version (1.3.1 at the moment).

Then you need to place Oracle JDBC driver ojdbc14.jar file in JRUBY_HOME/lib directory (other option is just to put somewhere in PATH).

All other installation should be done in the same way – just use “jruby -S gem” instead of “gem” and “jruby -S rake” instead of “rake” and it should install necessary gems for JRuby.

In addition before installing do_oracle gem you need to install do_jdbc gem (which contains general JDBC driver functionality):

# after installation of data_objects gem
cd ../do_jdbc
jruby -S rake compile
jruby -S rake install
# continue with do_oracle installation
Other DataMapper gems

DataMapper is much more componentized than ActiveRecord. Here I described how to install just the main dm-core gem. You can see the list of other gems in DataMapper web site.

To install additional DataMapper gems you need to

git clone git://github.com/datamapper/dm-more.git
cd dm-more
git checkout -b next --track origin/next
cd dm-some-other-gem
rake install

This was my first attempt to describe how to start to use DataMapper with Oracle. If you have any questions or something is not working for you then please write comments and I will try to answer and fix any issues in these instructions.

Categories: Development

Team Productivity Center Tutorial Published

Susan Duncan - Mon, 2009-07-20 05:57
There is now an Oracle By Example (OBE) tutorial available for TPC. It takes you through a number of topics including, on the admin side, setting up teams and integrating with repositories and, as a TPC user, querying repositories and creating relationships and tagging items across repositories.

It assumes that you have already installed or have access to TPC on the server. If not, here are instructions on doing that. The OBE includes images and examples using JIRA and MS Project Server but for a tutorial on the Rally Software integration, explore their site

And, as always, give me your feedback!

Too many Managers spoil the project

Krishanu Bose - Sun, 2009-07-19 07:37

All of us in our childhood must have heard of the proverb "Too many cooks spoil the broth". If too many people try to take charge of a task, the end product might be ruined. This applies to any task like an implementation project as well.An easy way to identify if the project is going awry is when you find many people following up to find the status of the job being done. In one of my earlier projects there was one developer writing a piece of code and there were four managers chasing the poor lady for updates and status. However, none of these managers were capable or inclined to help out the person writing a complex piece of code.One really felt bad when a bug was detected in the code and none of the managers took ownership and started blaming each other and the poor lady for writing the incorrect code.

So, the next obvious question would be wher the top management is blind to such mis-management or most of the time over-management (sometimes micro-management)? My answer would be a definite 'Yes'. For the top management what matters at the end of the day is billing and not success or failure of projects. They are mostly driven by short term objectives of ensuring that their bench strength is low and not the long term objective of ensuring customer satisfaction by delivering a good solution for the client. Also, with having too many managers, the internal dynamics of peer rivalry; of each person trying to show case himself as the better manager in the eyes of top management and trying to out-do the other in a selfish manner puts the project at a grave risk.

Most of us would have seen or been part of such a project. Do share your thoughts on why we staff so many managers when there is no necessity for so many managers without defining clear boundaries and scope and conflicting job area. And, if someone has changed such a scenario, do share your experience on how to change such a situation and bring the project back to track?

Post Lunch session -OSGI

Venkat Viswa - Sat, 2009-07-18 03:56
Lunch was extremely good and felt good after eating. Had only less though so as to keep in make.

Now the topic is on OSGI by Sameera Jayasoma . WSO2 is an open source company hased in Srilanka. Their main product is WSO2 carbon,Which is a fully componentized SOA platform based on OSGI. Then there was some PR on their company.

Modular Systems
Break large system into more smaller,understandable units called modules.Benefits of modular systems are reuse,abstraction,division of labour and ease of repair.

Module should be self contained,highly cohesive and loosely coupled.

Java for building Modular systems
--> provides class level modularity(public, non public methods)
--> we need somthing like external packages, internal packages in a jar

ClassLoader hierarchy : Bootstrap classloader (rt.jar) --> extension classloader (ext.jar) --> application classloader (a.jar,b.jar)

Problems with JARs

--> Jar is unit of deployment in Java and typical java app consists of set of jar files

--> no runtime representation for a JAR.

when java loads a class, it tries to load class one by one in the classpath.

--> multiple version of jar files cannot be loaded simultaneoulsy
--> Jar files cannot declare their dependencies on other jars

Java lacks true modularism and dynamism. Java has given flexibility to build system on top of it. This is called OSGI (dynamic module system for java)


--> Bundle is a unit of modularization of OSGi. OSGI app is a collection of Bundle.
Bundle is similar to jar and contains additional metada in Manifest.mf file. In osgi , java package is the unit of information hiding. unlike in jar when class is the
unit of information hiding.

--> bundle can share and hide packages from other bundles.

sample manifest.mf file

Bunle-Name :
Bundle-Version:1.0.0 (major,minor,micro version)

symbolic name and version are unique for a bundle. default value for version is 1.0.0
all packages in bundle are hidden from other bundle by default. if we need to share package explicitly mention the name.

Bundles & Class Loaders
OSGI gives separate classloaders per bundle,thereby eliminating hierarchial classloading in java

System bundle is a special bundle that represents the framework and registers system services

Tooling for osgi : eclipse pde is the best of the lot

osgi provides command line interface

ss -> lists all the bundles in the system

b/bundles - gives the list of informaiton about the bundle.export information.

b 0 --> gives system bundl information

export-hundle and import-bundle
require-bundle : import all exported packages from another bundle. but this is discouraged.

Issues with require bundle
Split packages,bundle changes over time,require bundles chain can occur.

fragment bundles : attached to a host bundle by the framework.Shares parent classloader.

runtime class loading in osgi: order of loadin

1) call parent clas loader (only for java.*)
2)imported packages
3)required bundles
4)load from its own internal classpath
5)Load from fragment classpath

Usage of fragment bundle 1) provide translation files to different locales

OSGI specifications --specifies framework and specificaions

osgi alliance

current version is 4.1

osgi can be considered as a layer on top of java.can also use jni to talk to OS. functionality of framework is deivided into several layers

1)module 2)lifecycle 3(

Lifecyce layer : manage lifecyle of api.
bundle starts --> installed,resolved,starting,active,stopping,uninstalled.

Register a service using bundle service using registerservice on bundlecontext

Using a service --> find a serviceReference,get the object,cast it to a proper type and use the service

Events and Listeners

framework fires serviceevents during registering a service,unregistering a service

services are dynamic. monitor services using service listeners,service trackers,declarative service,iPOJO and blueprint services.

Service Tracker

declarative service

SCR (service component runtime)

Powerful Reporting with BIRT

Venkat Viswa - Sat, 2009-07-18 00:18

This is the sesison that i hope to get the maximum benefits from especially since we have started using BIRT for our projects. The session is by Krishna Venktraman from Actuate, who is the director


--> Most applications have some kind of data visualization need. Real world applications don't consider reporting when they design the application. BIRT provides a framework that manages all the reporting requirements.

Traditional approach :

Buy closed source commercial products or build custom developed solution
With open source based products things become much easier.

Emergence of BIRT Project
BIRT was initiated in 2004 as a top level eclipse project. IBM,Innovent and Actuate are the key members.
Focus was BIRT was to make report development easy.Its open and standards based and provides for rich programmatic control. It has both simplicity and well as Power to create complex reports. BIRT supports of concept of reporting libraries that promotes reuse and reduces changes.

The main audience for BIRT was report developers,advanced report developers who use scripting, runtime integration developers who use birt viewer and engine apis, report design integrator who use design engine apis, extension developers who develop extention points and finally core development who do eclipse development itself.

There were five major releases since project launch with 1.0 ,2.0,2.1,2.2,2.3,2.5 as the versions. It was built from ground up and lot of community feedback was take into account

Key capabilities
--> Simple to complex layouts
--> Comprehensive data access
--> Output formats
--> Reuse and developer productivity
--> Interactivity and linking
--> Multiple usage and productivity aids

Some key features added in 2.x versions
--> ability to join datasets
--> enhanced chart activity
--> multiple master page support
--> Dynamic crosstab support
--> CSS files can be linked
--> Emitters for XLS,Word , PPT and Postscript
--> Webservices can act as datasource
--> Javascript/Java Debugger

BIRT design gallery : some of the displays llok really good.

High level BIRT acrhitecture

Two key components
1) Report Design Engine
2) Report runtime Engine

at the end of design process we get a .rptdesign. report engine then looks at the file, interprets it, fetches the data and goes about the generation process. we get an .rptdocument. Key services of report engine are generation services,data services,charting engine and presentation services.

BIRT exchange is a community site for posting all BIRT related issues.

a) Design Engine API b) Report Engine API c) Chart Engine API

Extension points
--> data source extensibility
--> custom business logic extensibility using scripting and acess java code
--> Visualization extensibility
--> Rendering content for output (emitters)

Deployment options

--> Commercial Report Server
--> J2EE Application server
--> Java application

Actuate provides Actuate BIRT report designer,BIRT report studio, BIRT Viewer,BIRT Interactive Viewer,deployment kits, iServer Express,iServer Enterprise.

Now for the actual report designs...

Just had an overview of the birt tool. Going through the series of demos on basic report, now basic charts, then crosstab/matrix report.

Book Marks and hyper links

Click the element and then pickup bookmark from properties . Now go to the place where you want to place hyperlink and link up the bookmark.

Limit what to display . You can limit at dataset level or at table level.

Sub Reports

Main Report --> Outer table
Sub Report --> nested table
Pass data value from outer table to nested table

In BIRT we need to nest tables in order to create sub reports.
Use Dataset parameter binding on the child set to get the data from parent dataset

BIRT Scripting

Mozilla Rhino script engine is embedded in BIRT.
Scripting = Expressions + Events
It users server side scripting. All the export options will get the same output.

Event Handling
Initialization Report level events (-initalize,-beforeFactory) --> Data source Open (-beforeOpen,-open) --> Data Set Generation (--beforeOpen,--open,fetch) --> Dataset Generation

Generation phase : Report level,datasource level, element level
Render : report level,element level

can implement powerful logic using scripting

Report Libaries
Just use export library by right clicking on the rptdesign file. Then click on use library and say use library.It has all the data sources, data sets and report items.
Library is a container of reporting items.
Can do local overrides on things imported from libraries

File --> New Template.Serves as starting points for speedy report development.
Display a visual image. then register this template with the new wizard.

Last piece was a demo on how to deploy the reports.

One big disappointment was i couldn't get any idea on how to integrate report engine and birt viewer with the custom applications.

On the whole it was a good session.

Keynote II

Venkat Viswa - Fri, 2009-07-17 23:53

Enhancing the developer productivity using RAD for websphere

--> Interesting the two main competitors give the keynotes one after the other

IBM Rational Architecture and construction
--> for solution,software and enterprise architects : Rational Data Architect,Rational Software modeler
--> for architects and designers who code in java,c++,xml --> Rational software architect Standard edition
--> Rational application developer --> for developers

IBM RAtional Applicaiton Developer for websphere

--> accelerates development
--> do even traceablity matrix
--> support for jpa and code generation

Comprehensive JEE5 tools

Unit testing is provided out of box
Visually layout JPA and EJB 3.0 classes
Convert UML to WSDL using RSA product
Provides excellent AJAX support

Enhanced support for Web 2.0
Declare POJOs and make it as REST service. Call Rest service as JSPs.
Javascript editor and debugger

JSF support
visual development of JSF pages
Data abstraction objects for easy data connectivity - SDO
Automatic code generation for data validation,formatting
Integration of third party JSF libraries

Portal development support is also excellent.

One of the very key features is to Automate performance and memory testing . This is built on top of eclipse TPTP.

Automates azpplication testing using WebSphere Application Server 6.0,6.1 and 7.0

IBMs strategy is to deliver high quality solutions by moving towards flexible architecture,automation layer,reduce onboarding

JAZZ platform : is meant for open community.

Mail id of the presenter is :bhrengen@in.ibm.com

Keynote address for the day

Venkat Viswa - Fri, 2009-07-17 23:52

First again a PR from SaltMarch :) .

The topic will be Plug-in to rapid development on Weblogic with Eclipse by Dhiraj Bandari

Dhiraj Bandari is as sales consultant from Oracle, moved on from BEA with the acquisition.

Oracle Enterprise Pack for Eclipse (OEPE) is a plugin that is really useful when we used weblogic application server integration. Provides the following features

--> Weblogic server (start,stop)
--> web services
--> spring
--. JSF + facelets
--> DB tools
--> ORM workbench

ORM workbench

--> creates the entity classes and helps to run all db functionalities
--> supports eclipselink,kodo,openjpa
--> has database schema broswer similar to TOAD

--> provides spring support

Tools for JAX-WS web services
--> New facets for weblogic web service development

Weblogic Server Tools
--> Run/deploy/debug locally or remotely
--> FastSwap ,shared libraries,Deployment plans
--> Migration support

Weblogic deployment descriptor editors

Oracle's strategy is to stop development on weblogic workshop. They will develop & enhance only JDeveloper and Enterprise pack for eclipse.

FastSwap Feature -- for iterative development

Traditional JEE Development cycle is Edit --> Build --> Deploy --> Test

Using Modern IDES it becomes Edit --> Deploy --> Test

FastSwap's goal is to eliminate the Deploy step Edit --> Test

FastSwap detects changes to class files,redfined changed classes,Non invasive and development mode only

Demo on FastSwap operation

How to enable fast swap feature --> go to weblogic application deployment descriptor and ebale fast swap. Then instant chagnes to ejb classes,web classes can be seen.

Day 2 live blogging - EclipseSummit India

Venkat Viswa - Fri, 2009-07-17 23:51
Participants are quiely settling in. Strength has considerably dwindled compared to yesterday. There was unexpected drizzle in Bangalore , causing me to get partly wet and making me feel miserable in an AC room.

Wireless Internet connection does not seem to work as expected :(. Hope to post all these one by one when i am back in the network.

Expectations for today
Today I am eagerly looking forward to attend BIRT workshop in the morning followed by a sumptuous lunch and then another workshop on OSGI.

Writing Non-ASCII Content into MQ

Ramkumar Menon - Fri, 2009-07-17 11:06

I had Arabic characters coming in from a partner webservice that I needed to write out to an MQ.
The default version was not writing out data into the MQ as expected - the Arabic data was being written out as a bunch of unreadable characters.
Following this, I followed the steps mentioned in the document http://download.oracle.com/docs/cd/E12524_01/relnotes.1013/e12523/adapters.htm#CHDDCAGA.
That did the trick!

JPA 2.0 New Features

Venkat Viswa - Fri, 2009-07-17 04:30
JPA 2.0 is releasing 2009 fall. (JSR 317)


--> Fil in ORM mapping gaps
--> Make object modeling more flexible
--> offer simple cache control abstraction
--> allow advanced locking settings
--> JPQL enhancements

More standardized properties
--> some properties are used by each and every driver

Persistent unit properties like javax.persistence.jdbc.driver, javax.persistence.jdbc.url

JPA 2.0 supports join table as well as f key relationships.
Collections of embeddables or basic values.

This is made possible using elementcollection annotation

order is maintained even if you move things around by using an index.

More Map flexibility
Map Keys and values can be : Basic objects,embeddables, entities

Enahcned embedded support
Embeddables can be nested and can have relationships

Access Type options
--> mix access modes in a hierarchy (field or properties)
@Access annotation

Derived Identities
JPA 1.0 relationship field cannot be part of the id

JPA 2.0 @Id + @OneToOne

Second Level Cache
API for operating on entity cache which is accessible from EntityManagerFactory
Supports only ver basic cache operations , which can be extended by vendors

@Cacheable annotation on entity (default is true)

There is also a property by the name shared-cache-mode to denote per PersistenceUnit whether to cache.
--no entities
--only cacheable entities
-- all entities

Properties cacheRetreiveMode and cacheStoreMode per EM method call whether to
read from cache

1.0 allows only for optimistic locking
2.0 provides for optimistinc locking by default
pessimistic locking can be used per entity or query

Lock mode values introducted
Optimistic (=READ)

API Additions
Lockmode parameter added to find,refresh
Properties parameter added tofind,refresh,lock
Other useful additions
void detach(Object entity)
Query API addition
Enhanced JP QL
Timestamp literals
Non-polymorphic queries
IN expression may include collection parameter --> IN (:param)
Ordered List indexing
CASE statement

Criteria API
Similar to eclipselink expressions,hibernate criteria
Criteria API - Canonical Metamodel
--> For every managed class , there is a metamodel class

Load State Detection
JPA can integrate with Bean validation (JSR 303) : Hibernate Validator is an implentation

JPA 2.0 shpped as part of Java EE6 release


Venkat Viswa - Fri, 2009-07-17 04:01
Back after a sumptuous lunch

Tool by Embarcadero technogies : http://www.embarcadero.com/products/j_optimizer/

Available standalone as well as eclipse plugin

--> Detecting excessive object allocation

--> memory leaks

--> detecting bottle necks

--> code coverage/code quality

--> thread debugging

--> Breakdown JEE requests

--> request analyzer

remotely connect and find which layer is causing problems. Can go into any level of detail.

code coverage

how to analyze and find out threading issues ?

--> Detecting deadlocks and visually analyze the deadlocks.


Patterns in eclipse

Venkat Viswa - Fri, 2009-07-17 01:57
Three rules of eclipse

plugin may not change screen,task and create objects unless user asks for it

1) User owns the screen

2) User owns the CPU

3) User owns the memory

--> Do not use singleton pattern.Memory allocation never goes away

Building the UI withoug loading plugins

Decoupling using adapters
--> dynamic implementation of an interface
--> class can be adapted to any interface
--> best example is the properties view

4) most of the items are implemented as services
Located,Scoped and Destroyed

5) Separation of concerns
same class should not do a,b,c,d,e
use handlers
6) scalable UI
browse instead of combo
filters instead of presenting a large set of info
always use group data in relevant sections
provide deselect /select all buttons
differentiate and place common buttons appropriately

Eclipse and Building Data Centric RIA

Venkat Viswa - Fri, 2009-07-17 00:50
Demo of portal type application using flex
Interactive charts --> looked really good with nice drilldowns

Rich Internet Applicaions
1) REal time data push
2) resizable
3) Rich Data entry
4) Chat
5) Data Synchronization
6) Audio and Video
7) Offline

Open Screen platform : Adbobe flash platform

clients --> AIR and flash player

Servers/services --> Blazeds,data services

Flex framework

tools to design and develop : flex builder

Understanding flex

written in mxml markup

flex sdk is free and opensources

flash builder : eclipse based professional IDE

benefits :

UI goes to client only once . after that only data changes..

Approach for Developing RIAs

Design focused
Data focused


Testing and Deployment


Model Driven development


1) Create a new project

2) Create a data model (fml file)

3) Deploy model to LCDS (Live cycle data services)

4) import fml file

5) create mxml and add datagrid.

6) Dnd datamodel to data grid

7) Run application.

Business logic can be written in custom assembler. Normal one is fiber assembler.

Even tomcat is fine. Internally fml creates java classes at runtime during startup.

Data Centric Development using Flash Builder

1) Define Service (CF,php,java,soap,rest)

2) Model Service (flash builder examines service, builds design-time model)

3) Bind Operations to Flex UI Components (data binding,UI generation,Paging,Data-management)

AMF : Action script messaging format used for sending and reciving data , more efficient than json and xml.

Testing and deployment

Network monitor
unit testing framework
Command line builds ( coming soon)

Demo of Ruby service plugin

Data Centric Development Extensibility

Extension points
Key interfaces and classes for custom service
Key interfaces and classes for componentConfigurator

Flash Catalyst

Imports photoshop files and analyzes it. Based on eclipse platform. takes mockups and creates flex application based on them. Generates flex code behind the scenes.

Wow.. thats too good

Require flash builder license and run time license for LCDS


Tour de flex : www.adobe.com/devnet/flex/tourdeflex/

EclipseLink : High Performance Persistence

Venkat Viswa - Thu, 2009-07-16 23:48
I have used eclipselink on one of the key projects lastyear. It was donated by Oracle to Eclipse foundation. Toplink became eclipselink. I was really impressed by its implementation of JPA and customizations such as Criteria Queries. Hoping to learn more from this session.

EclipseLink Architecture

Supports JavaSE,EE,OSGi and Spring

Eclipselink solution comprises JPA implentation,Moxy,EIS,SDO(service data objects),DBWS (database webservice --> want xml from relational data ).

--> supports JPA 1.0 with many advanced features
--> simplified configuration of using annotations and/or xml.
--> Best ORM for Oracle database

Tool Support
-->EclipseLink is a runtime project supported by IDEs.
-->Eclipselink supported by Dali
-->Oracle Jdeveloper 11g,Enterprise Pack for eclipse
--> Netbeans
--> Standalone workbench(Swing project)

Eclipselink distributions
--> Eclipse,Oracle toplink,weblogic,glassfish,spring framework,JOnAS

JPA persistence Provider(eclipselink) sits between Java SE/EE and rdbms

Core JPA Mappings

ID (primary key)
Basic (field mappings)

Mapping Annotations
Query hints
Advanced Mappings
Eclipselink orm.xml

Examples of Advanced Mappings
class level --> @Converter(name="",converterClass="")
field level --> @Convert(name="")

@PrivateOwned (coming in JPA 2.0) : doesnt exist without parent

Caching :

Optimistic locking :

Custom Data type conversions:

Query Framework

5 different ways

Entity Model : JPQL
Native : SQL
Stored Procedures

Customizations in queries
--> Locking,Cache usage
--> Optimizations (batching,joining)
--> Result shaping/conversions
--> Stored Proc support

SQL and Stored Procedure directly hit db.

For other 3 query framework is used. Checks for Cache hit,Cache result is used using Object builder)

Annotations for stored procedures
@NamedStoredProcedureQuery and @NamedStoredProcedureQueries

e.g. @NamedStoredProcedureQuery(name="",procedureName="",parameters={})

eclipselink.read-only : useful in read only screens

Lazy loading & Fetch Groups
Two fetch groups defined automatically --> eagerly loaded fields and lazily loaded fields.Enabled by byte code weaving

Create your own fetch groups and added to query as hint. Overrides default fetch groups.

Caching Advantage :

Shared L2 and persistence context caching
--> Entity cache and not data cache like ehacache that comes with hibernate

Cache Invalidation --> time to live,fixed times, programmable

Cache Coordination --> Messaging,Type specific configuration (invalidate,sync,sync + new,none)

Invalidate is the most used and cheapest one

Annotations for caching : @Cache,@TimeofDay,@ExistenceChecking

Concurrency Protection :
@OptimisticLocking : Numeric,Timestamp,All Fields,Selected fields,Changed field

Pessimistic locking : using hit eclipselink.pessimistic-lock

Dealing with DB Triggers

@ReturnInsert and @ReturnUpdate : efficiently reread modified data in Oracle db.

Change Tracking
@ChangeTracking annotation to configure the way changes to Entities are computed
Attribute level ,object level, deferred ,auto

Performance Options summary
--> ChangeTracking
--> Read only queries
--> parameter binding
--> joining
--> inheritance
--> concurrency
--> dynamic expressions

Moxy : Object XML Binding

JavaApp --> Objects --> EclipselinkOXM --> xml

Rich set of mappings provides complete control to map objects to any XSD.

Eclipselink JAXB2 Annotations , Moxy XML

twice as fast as sun ri and xml beans.

API steps
1) Create factory,context
2) Marshal and UnMarshal

SDO : Xml Centric

Wow.. too fast session .. but left me lots to explore in JPA.

Eclipselink 1.1.2 released as part of Galileo

Eclipselink 2.0 --> Fall 2009 ; implements JPA 2.0

DBWS : Generated JAX-WS from DB

Keynote address - Day 1

Venkat Viswa - Thu, 2009-07-16 23:06
First PR on Saltmarch going on :).

Sponsors : Platinum --> Oracle,IBM and Microsoft
Gold : Actuate,Adobe etc

Key note speaker will be Ramkumar Kothandaram from Microsoft

What is microsoft doing in an eclipse conference !!!

Topic will be interoperability.


--> Microsoft's approach to interoperability
--> Open source & Microsoft platform

Need for interoperability

We have diversified client applications (firefox,ms office,Open office , IE8) and server applications (Jboss,.NEt etc..) , storage(EMC2,netapp) , multiple databases, processors(intel,ibm,sun).

Customers buy heterogeneous hardware/sofware. Painful EAI projects used to take a long time. This resulted in interoperability evolution.

Microsofts approach to Interoperatbility

--> Products : All products natively interoperability
--> Colloboration : with Partners,competitors and open source community
--> Standards : Promote interoperability through new and existing standards
--> Developer resources : msdn,codeplex etc


All products like Windows Vista,.net ,Win server 2008,office 2007 support interoperability.

Can consume and expose webservice endpoints.


Apache stonehenge : Project to test for interoperability between various vendors.

MS part of interoperability alliance. Took leadership in webservices interop.


Participates in over 150 standards bodies

Developer Perspective

PHP on Windows --> PHP FastCGI on IIS

Seems that PHP on windows scales as fast as Apache ..

Then there was introduction to Microsoft Azure which is microsofts cloud computing platform.

Eclipse tools for sliverlight (eclipse4SL) : eclipse plugin for silverlight from soyatech. Looks good to me :). Can build RIA and embed in Html.

Java API for open XML : standard for storing documents. Create a document for server side. http://poi.apache.org

Links to remember


Codeplex : 80000 open source apps on MIcrosoft application.

On the whole it was a good eye opener on microsoft and its contribution to interoperability.

Live Blogging from Eclipse summit - Bangalore

Venkat Viswa - Thu, 2009-07-16 22:57
Here I am back again with live blogging from Eclipse summit Bangalore.

We are minutes away from launch and there seems to be a lot of Java/Eclipse lovers. The ballroom is really full.

The keynote address is set to begin

Connecting with Team Productivity Center

Susan Duncan - Thu, 2009-07-16 04:05
Well, it's been quite a couple of weeks. TPC was featured in the developer tools section of the Fusion Middleware 11g launch and got some good press coverage (for instance eWeek) and the bloggers were our in force. You can watch the launch and see Duncan Mills use TPC in his demo. He has also recorded an Oracle Videocast and Podcast introducing TPC.

My aim is to get as many users to download and use it as possible (actually, that is every Product Manager's aim for their product!) That is going well, but I could do with your help to get the news out there. The ALM repositories we integrate with currently are all leaders in their field. The JIRA integration is a great productivity booster and the more I work with JIRA the more I realise how flexible it is. Microsoft Project Server is widely used in enterprise organisations and Rally Software is a world leader in agile development.

We are working on additional connectors (more news on that when I can divulge more) but there is always room for more. I'd love to hear from you on what ALM repositories you would like to see TPC integrate with. I'd love to hear from you if you have an internal system you would like to write a connector to integrate it with TPC. In fact, I'd love to hear from you in any capacity concerning TPC - and that, of course, includes those of you who have reported bugs too ;-)

John Stegeman, an Oracle Ace Director, is interested in creating a connector to TRAC. He announced this with a JDeveloper forum post saying, " I've been thinking about writing a connector for an issue management system that I use (of course, there had to be a selfish reason), TRAC. I think an ideal way to do this would be with a small team of developers working together on the new sample code site hosted by Oracle (http://www.samplecode.oracle.com). "

I think this is a great idea. It would be about a month of effort and you would get the opportunity not only to get to know our connector framework but to work as part of a small team and gain experience to perhaps go on to creating a connector for something within your own organisation. You can contact John through the forum post. I would highly recommend it (well, I would, wouldn't I?)

So, download, use, report, connect, and code - yep, that about covers it!

2 members JHeadstart Team in Oracle Innovation Showcase

JHeadstart - Thu, 2009-07-16 00:07

We are honored that 2 of our JHeadstart Team members are included in the Conversations with Oracle Innovators of the Oracle Innovation Showcase.

Full credit to Steven, who is the driving power behind the JHeadstart innovations!

Categories: Development


Subscribe to Oracle FAQ aggregator