Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Saturday, June 25, 2011

Introduction to Oracle J2EE Application Development Framework: Oracle ADF

If you are Java Developer and looking for a great, future proof J2EE Framework, you are at right place.
Oracle J2EE Framework has been evolved for more than 10 years. It has been improving in every release and still intensively developed by Oracle. In fact, it is the core development framework for Oracle Fusion Applications (Oracle E-Business, SOA Suite, WebCenter etc).

It started using the name Java Business Object (JBO, that's how oracle.jbo package came from), then change into Business Component for Java (BC4J), then Oracle Application Development Framework (ADF). Despite of these different naming, basic design principal is still the same with enhancement, features, bug fixes, etc.

I learned this framework since version 9i and all the experiences I had since then are still valid and it's never been a wasted effort, and i am really glad about it.

There are three main components of Oracle ADF:
1. Model
2. View
3. Controller

Simple explanation for above components:
Model is where your business data is stored (Persist).
View is where users view the Business Information based on the Model.
Controller is the connectors or links for your Views.

OK, let's start with a very basic Oracle ADF sample project. Typically, ADF Application has two projects: Model and ViewController.


Model Project contains all your business data objects. You can use different technology for this. Currently it supports ADF Business Component (XML of your database tables), Plain XML, Toplink, Text File, etc.

ViewController Project contains all your Web Application pages and ADF Controller XML files.


In above screenshot, i'm using ADF BC (That's it AppModule, Emp, EmpView are my Business Components which are built using ADF BC) in Model Project and Facelets (Emp.jsf) with ADF Controller (adfc-config.xml) in ViewController project. I hope with this very brief explanation of Oracle ADF could help you to understand what is Oracle ADF and its components.

Want to see the demo? check out this link Oracle ADF demo

Cheers!

Wednesday, May 18, 2011

So when to use Active Data Guard or Golden Gate?

On my previous post, I posted some differences between Active Data Guard and Golden Gate. But some people may find it more confusing and ask when should I use Active Data Guard? or Golden Gate?

So let me try to summarize it here:

Use Active Data Guard for:
Disaster Recovery, Data Protection/HA (Oracle environment)

Use Golden Gate for:
Information Distribution, Data Integration, Cross-platform migrations (For ex. SQL Server to Oracle)


They can also complements each other.
ADG provides read-only replica for standby database, and GG capturing standby archive logs then replicating it to 'n' different target systems.

Saturday, May 14, 2011

What's the difference between Active Data Guard and GoldenGate?

Active Data Guard vs Golden Gate?

Active Data Guard (ADG) is a replication technology from Oracle to create exact mirror of one database.
GoldenGate (GG) is a heterogeneous database replication from different database vendors to one or more target repository (Database, File, JMS Queue, etc.).

Summary of the differences between ADG and GG:

Active Data Guard:
- Ship from memory
- Sync or Async
- Simple one way replication
- Standby open read-only
- Zero I/O overhead, near-zero primary performance impact
- Standby database is exact physical replica
- No data type or other restrictions
- Integrated with Oracle Kernel

GoldenGate:
- Read and ship from redo logs (configurable to read directly from table, if necessary)
- Async only
- Advanced, multi-master replication (if conflicts can be avoided or resolved)
- Target database open read-write
- I/O Overhead and capture processing on primary
- Replica is logical copy maintained using SQL
- Data type and other restrictions
- External to Oracle Database

From licensing perspective, GoldenGate bundles Active Data Guard together.

Tuesday, April 26, 2011

Out-of-the-box Result Caching with Oracle Service Bus

On my previous post (http://rickyhp.blogspot.com/2011/04/creating-robust-scale-out-data.html), i have shared about Data Abstraction and Cache with Oracle Coherence. Today let's see how Oracle Service Bus can provide out-of-the-box data cache solution for your existing web services without changing any of your application's code.

Oracle Service Bus provides out-of-box caching mechanism using Oracle Coherence. You can use it to cache result from any Business Services.
This can dramatically improve performance if the response from the business service is relatively static.
Oracle Service Bus uses a single cache for all business services. Only valid/correct results from business services are cached.

For cache expiration, cached results have a time-to-live (TTL) attribute.
You can configure cache expiration either with the Expiration Time property in the Result Caching configuration on the business service or the cache-ttl element in the $transportMetaData using the proxy service message flow.

If Oracle Coherence finds that the TTL has expired, it flushes the cache, and the business service invokes the external service for a result. That result is then stored in the cache (if there is no error in the result), and the result is available in the cache so that it can be returned to the next request.

The following events illustrate how Oracle Service Bus/Coherence flush cache:

•Cache TTL has expired – Each cached result has its own TTL. When a TTL is reached, Oracle Coherence flushes that individual cached result.

•Disable result caching on a single business service – When you disable result caching on a business service, Oracle Service Bus triggers flushing of all cached results for that business service in Oracle Coherence.

•Update, Rename, or Delete a business service – If you update, rename, or delete a business services, Oracle Service Bus triggers flushing of all cached results for that business service from Oracle Coherence.

•Update dependent resource – When you update a dependent resource, such as a WSDL, Oracle Service Bus triggers flushing all cached results for that business service from Oracle Coherence. However, changes to the following dependent resources do not cause cache flushing: Service Provider, UDDI Registry, Alert Destination.

•Globally disable result caching – When you globally disable result caching, Oracle Service Bus triggers flushing the entire result cache (all cached results for all business services) from Oracle Coherence.

For details, please refer to below link:
http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15867/configuringandusingservices.htm#OSBAG170

Oracle Fusion Middleware and Java Support Policy

Many people confuse with Oracle Support Policy regarding Oracle Fusion Middleware and Java, especially after Oracle acquires Sun Microsystem.

Any Oracle Fusion Middleware products (including Oracle WebLogic Server and Oracle Application Server) are supported as a single unit. When Java SE is used to run an Oracle product, it is treated as an integrated component in the product and follows the End of Life of the middleware product.

Examples:
  • End of Life (EOL) was announced for J2SE 1.4.2 in June 2007 and for J2SE 5.0 in October 2009. Several versions of Fusion Middleware products run on these versions of J2SE. The J2SE End of Life only applies to J2SE when used standalone or with 3rd party applications. For Fusion Middleware, the Oracle Lifetime Support Policy Extended Support time lines take precedence.

  • When Oracle announces End of Life for Java SE 6 or a later version of Java SE, that announcement only applies for Java SE used standalone or with a 3rd party product. For Fusion Middleware, the Oracle Lifetime Support Policy Extended Support time lines take precedence.
Hope this helps people who has concerns on Oracle Product Support Policy

Cheers!

Sunday, April 24, 2011

Creating a robust, scale-out data abstraction layer with Oracle Coherence

Oracle Coherence is an in-memory data grid solution that enables organizations to predictably scale mission-critical applications by providing fast access to frequently used data. Data grid software is middleware that reliably manages data objects in memory across many servers. By automatically and dynamically partitioning data, Oracle Coherence enables continuous data availability and transactional integrity, even in the event of a server failure. Oracle Coherence provides organizations with a robust, scale-out data abstraction layer.

In today post, i will guide you through how to install, configure and run simple Java Coherence Application. Hopefully, it could help people understand the basic concept of Coherence and able to implement it in their real project. Good Luck!

1. Download the latest version of Oracle Coherence for Java here:
http://www.oracle.com/technetwork/middleware/coherence/downloads/coherence-101246.html

2. Download JDeveloper 11.1.1.3 here:
http://www.oracle.com/technetwork/developer-tools/jdev/downloads/soft11-098086.html

3. Unzip and Install Oracle Coherence and JDeveloper.
Ensure that the directory name you install into does not have any spaces.

4. Configure Java Home and Coherence
1. Setup JAVA_HOME for Oracle Coherence
• In the coherence.cmd and cache-server.cmd (located in [COHERENCE_HOME]\coherence\bin) set the JAVA_HOME variable to point to your JSDK 1.6 environment.

SET JAVA_HOME=[JDK PATH]

In Windows explorer change to the [COHERENCE_HOME]\coherence\bin directory.

• In the file coherence.cmd (or coherence.sh), find the line with set storage_enabled and
change the value false to true.

set storage_enabled=true

This option specifies if a process is a “Storage Enabled Member” when joining the cluster. Storage enabled members can store data as part of a Coherence cluster.

• Save the files and exit.

5. Run Coherence Cache Server
• From the [COHERENCE_HOME\coherence\bin directory run the following file: cache-server.cmd
• This will start up a storage enabled member in the cluster. When you start the first cache-server up you will notice a slight delay as the cache server looks for an existing cluster. Once it determines there are no clusters to join, it will start one.

Note: by default Coherence uses multicast to search for cluster members only. Multicast is not used for data transfer. If you cannot use or do not want to use multicast then this can be configured.

• You should see a number of messages displayed and at the bottom of your console, you should see below message:

Started DefaultCacheServer...

6. Run coherence console and test the Cache Server
  • Run coherence.cmd (windows) or coherence.sh (unix/linux)
  • You should now see the following prompt:
    Map (?):
  • This application shows you the basic distributed cache functionality build within
    Coherence
  • Type in the following to create a new named cache called test.
    cache test
  • Each named cache can be thought of as a table. A cluster can have many named caches. Each named cache holds one type of object. It can be a simple object such as a String, or a complex object that you define
  • Type in the command help to see the list of commands available. The following
    commands are the ones you will use most:
    • put – puts a name value pair (key and value) into the cache. Always returns the last
    value that the key had; get – retrieves the value for the given key from the named cache;
    • list – shows the contents of the named cache;
    • remove – removes a key value from the cache
  • Use the commands above and put and get some values. For ex. put name John [enter], get name [enter]
7. Create Java Application and connect to Cache Server
Since you're going to use Coherence API. You must configure coherence java libraries (under your [COHERENCE_HOME]/coherence/lib) before writing and compiling the applications.


Below is the code that you can use to put and get some value from Cache Server:

import com.tangosol.net.CacheFactory;
import com.tangosol.net.NamedCache;

public class MyFirstSample {
public MyFirstSample() {
}

public static void main(String[] args) {

// ensure we are in a cluser
CacheFactory.ensureCluster();

// create or get a named cache called mycache
NamedCache myCache = CacheFactory.getCache("mycache");

// put key, value pair into the cache.
myCache.put("Name","John");

System.out.println("Value in cache is " + myCache.get("Name"));

}
}

That's it. Congratulations! you have successfully created your first robust, scale-out java application using Oracle Coherence Data Cache Solution. With this simple example, you could have different data sources i.e. Oracle Database, SAP, Siebel, etc. and put them onto the Cache Server that a variety of clients can connect, get some valuable information from it.


Tuesday, April 19, 2011

Oracle has two approaches for BPM:
1. Using BPMN and BPEL along side by side, and run them with single runtime engine (BPM Suite + SOA Suite)
2. Using BPMN and generate or merge it into BPEL, and run them with BPEL engine (BPA Suite + BPM Suite + SOA Suite)

How does it transform business process into a BPEL process?

The business process models are abstract and have to be implemented before they can be realized. Once business decides that a specific version of the process model is ready for implementation, the model is marked for IT implementation and saved in the Business Process Repository. The blueprint can now be used to create a BPEL process in Oracle JDeveloper.
BPEL transformation generates Process Blueprint and associated skeletal BPEL code. The IT developer needs to add implementation details to the BPEL code to convert it into an executable process that can be deployed on the run-time engine (BPEL Process Manager).

The transformation a business process into a BPEL process comprises the following:
■ Notification Services are transformed into a Business Scope upon BPEL transformation. The corresponding Notification service as well as the BPEL artifacts for invoking the Notification service are created within the business scope.
■ Human tasks are converted to a human workflow business scope upon BPEL transformation. The Task Service gets automatically generated as well as the BPELartifacts for invoking the Task service also gets generated. The Notification/Reminder notes get translated to business annotations.
■ Automated activities are converted to a business scope upon BPEL transformation.
■ Business Service is converted to a Partner Link upon BPEL transformation. If the Business Service is associated with a concrete WSDL, it is converted to a concrete Partner Link. Otherwise, it is converted into an abstract Partner Link. If Represented by is set to "invoke", an invoke activity is created inside the business scope and is linked to the Partner Link. If Represented by is set to "receive", a receive activity is created inside the business scope and is linked to the Partner Link. The Sensor definition is converted in to a business annotation.
■ XOR, AND and OR gateways are converted to switch and case statements upon BPEL transformation.
■ All Business Data in the Business Process Diagram are converted to Variables upon BPEL transformation. If the Business Data is associated with an XSD, the XSD is exported and the Variable in the BPEL skeletal process generated is then set to the XSD type. Otherwise, the Variables are set to String type.
■ Business Rules are converted into a Decision Service. The free text in the Rules field is converted into business annotation.

BPA View




BPEL View in JDeveloper



Cool..you can switch BPEL view and BPA view.

BPM Studio documentation stated somewhere that we can convert bpmn process to bpel which i can't find it. Because when you create SOA project from JDeveloper and connect it to BPA Repository, it will only convert it.

Sunday, April 17, 2011

Securing your Enterprise Web Services using Oracle Enterprise Gateway 11g


Oracle Enterprise Gateway is positioned for First Line of Defense in your company's DMZ.


Here are the list of some features you could get from Oracle Enterprise Gateway:


1. XML Firewall



  • Checking for XML well-formedness

  • XML document size

  • XPath and XQuery injection

  • SQL injection

  • XML encapsulation

  • XML viruses

  • Scanning outgoing messages for sensitive content based on metadata or regular expression patterns

  • Detecting XML bombs and XML clogging

  • Scanning WSDL files

2. Accelerated XML Processing



  • Frees up resources on application servers

  • Enables applications to run faster

  • Patented acceleration engine

  • Faster XML validation

  • Faster processing of XML queries and transformations

Oracle Enterprise Gateway could be used together with Oracle Service Bus for Web Services Virtualization and Last-Mile Security (as shown in above picture).