TechnoBuzz

A Techno Blog, mainly about Java

SDO

Link: IBM blog.

January 15, 2005 Posted by | CommonJ | Leave a comment

More on SDO

SDO: The BEA and IBM collaboration. Once called WDO, now its SDO. Data Graphs. The Server Side has an entry on it.

October 1, 2004 Posted by | CommonJ | Leave a comment

Java Server Faces

JSF – Its focus is in the V of an MVC architecture. Bill Dudney has a book out on JSF. Here is a link that takes you to article on JSF also authored by Dudney.

Redbook that combines JSF with SDO is here.

JSF presentation

Core JSF

One experience

MyFaces

August 7, 2004 Posted by | CommonJ, JSF | Leave a comment

JDO with JPOX

JPOX: a free and full compliant JDO implementation released under an open source license.
JPOX Tutorial

JPOX Install info:
Setting up the environment requires EMF, com.versant.eclipse.jdo_0.9.9_e2.zip, com.versant.eclipse.jdo.jpox_0.9.9_e2.zip.
You can download the the JPOX eclipsejdo.org plugins here .
I also grabbed the com.versant.eclipse.jdo.doc.user_0.9.9_e2.zip which I extracted and added the folder to eclipse plugin folder. Note that to access the help after the doc plugin is in effect, do help contents in eclipse.

For my project, needed following Jars: bcel.jar, btree.jar, db2jcc.jar, jdo.jar, jdo-ri.jar, jdori-enhancer.jar, jpox-enhancer.jar, log4j.jar. Instead of using the jpox jar, we referenced a different project which contained the jpox source. In the jpoc source project, had the ant.jar, bcel.jar, btree.jar, connector-api.jar, db2jcc.jar, jdo.jar, jdori.jar, jdori-enhancer.jar, jta.zip, log4j, and the oracle jars.

for the enhancer, I am running using WSAD. In run…, created a new application within my project. The class that is referenced is org.jpox.enhancer.JPOXEnhancer which executes on my projecting.jdo file (argument org/jpox/tutorial/package.jdo)

Reference the logging file to get info on how to set up log4j. I set up a JVM variable for my class : -Dlog4j.configuration=file:org/jpox/tutorial/log4j.properties

One thing to remember is to always run the enhancer after each compile.

Now, the main.java which performs the persistance. One thing I noticed when I ran the class is that it creates the table, but nowhere is the schema indicated. Something I need to find out how to specify.

package org.jpox.tutorial;
import org.jpox.*;
import java.util.Properties;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Transaction;
import model.Person;
public class Main
{
public static void main(String[] args)
{
// Properties for connection
Properties properties = new Properties();

properties.setProperty(“javax.jdo.PersistenceManagerFactoryClass”,”org.jpox.PersistenceManagerFactoryImpl”);
properties.setProperty(“javax.jdo.option.ConnectionDriverName”,”com.ibm.db2.jcc.DB2Driver”);
properties.setProperty(“javax.jdo.option.ConnectionURL”,”jdbc:db2://url:portnum/dsn”);
properties.setProperty(“javax.jdo.option.ConnectionUserName”,”db2inst1″);
properties.setProperty(“javax.jdo.option.ConnectionPassword”,””);
properties.setProperty(“org.jpox.autoCreateSchema”,”true”);
properties.setProperty(“org.jpox.validateTables”,”false”);
properties.setProperty(“org.jpox.validateConstraints”,”false”);

// PMFactory creation and getting the PM instance
PersistenceManagerFactory pmfactory = JDOHelper.getPersistenceManagerFactory(properties);
PersistenceManager pm = pmfactory.getPersistenceManager();

try
{
pm.currentTransaction().begin(); // opening a transaction

Person dude = new Person(); // creates one Person

Product product=new Product(“Sony Discman”,”A standard discman from Sony”,49.99);

pm.makePersistent(product);

pm.currentTransaction().commit(); // committing the transaction

}
finally
{
// if the transaction is still active, rolls it back
if( pm.currentTransaction().isActive() )
{
pm.currentTransaction().rollback();
}
pm.close(); // close the PM
}
}
}


Some of the packages in the jpox jdo include: javax.jdo, org.jpox.

a thesis has been written
comparing JDBC to JDO

Object Identity provides training for the JDO API.

JDO vs SDO

JDO Implementations

OJB or now known as the apache db project.

July 25, 2004 Posted by | CommonJ, JDO | Leave a comment

SDO

IBM & BEA Share the Technologies (commonJ). Consists of SDO (originally IBM called it Websphere Data Object but renamed to SDO), WorkManager for Application Servers (API to schedule work items for concurrent execution), and Timer for Application Servers (API for setting timers to do work actions like CRON within container).

They approached each other, then created JSR235: “Defines core infrastructure APIs for heterogeneous data access that supports common application design patterns and supports higher-level tools and frameworks.”

SDO Overview
SDO
Spec
  SDO
Paper
 –

Webspshere 6 is slated to include SDO later this year. JSF with SDO redbook

With SDO it is what do you want to do, not what technology do you want to use. A higher level of abstraction.

More easily to bind, query, view, update, introspect data.
The data comes from different places (heterogeneity), decouple application code from data access code.
Support for Tools and Object/Relational disconnect.
SDO has API that is applicable to all types of data sources, dont assume back end store.
Based upon disconencted data graphs (tree or graph structured data) – retrieve graph, update the graph, and apply changes back to data source.
Access to data with classes which use data mediator services.

Data Transfer Object – move several pices of data over the network in a
single call in order to reduce number of method calls. Usually an assember is
used to keep the domain model and the data transfer objects independednt of each
other.

EMF 
(tutorial as
shown here:
example)
uses SDO.
[Data Transfer Object (DTO) pattern]

[jdo central article]

[server side article]

July 20, 2004 Posted by | CommonJ | Leave a comment