Wednesday, March 16, 2016

Get Started with Oracle 12c - Hello World Example


Prerequisites:
  • Install Oracle SOA 12c
  • Configure default domain and start the server

Let’s get started with the example. First create a new SOA application,If you are not able to see SOA Application then first you need to install Extension SDK in Jdeveloper

Name your SOA application and BPEL process. We choose standard composite as we are not creating this composite from any template.

Once you create the composite, Drag BPEL process to it.

Add synchronous BPEL to the empty composite.

Add assign activity which simple assign request to response.

Now deploy your composite to integrated server.

Once you deploy it go to Application Servers and go to IntegratedWebLogicServer -> SOA -> Default Server -> {Partiiton_Name} -> {Composite}

Right click on the composite to test it. You may face below error when you try to test it.

Error: Error occurred while opening service WSFL URL

To avoid this error we need to disable SSL listen port for server. To do that goes to admin console (http://host:port/console)

Click on Home -> Servers ->Deafultserver -> Configuration ->General

Un-check “SSL Listen Port Enable” and restart the server.

Now test again your composite.

You see it will open HTTP Analyzer and we can test the composite from here only. We need not to open EM console and test it from there.

Provide input value and you see response.

Oracle SOA 12c Features


Oracle has released SOA Suite 12c and lots of new features are introduced in this release. Below is list of some of the new features.

Single Installer: Oracle Suite 12c comes as single installer for developers that means you only need to install only one setup (SOA Suite 12c), DB/Weblogic/SOA will get installed, you need to install it separately. Oracle SOA 12c use Java Derby database, which is file based and that makes it really fast.

Single IDE: In Oracle SOA 12c Jdeveloper is used as IDE for all designs. For OSB development we need not to use different IDE (Eclipse) anymore, we can develop OSB application in Jdeveloper itself.

Debugger: This is new feature in Oracle SOA 12c, debugger is introduced to debug SOA and OSB applications. With the help of debugger we can debug our code before deploying it; this saves lot of development efforts. We can also change message text while debugging it.

Graphical MDS: In Oracle SOA 12c graphical tool is provided to publish, search and consume filed from MDS and OER.

SOA Templates: With the introduction of templates sharing of code between teams become earlier and development efforts reduced. There are three types of templates introduced.

  • Project Template
  • Component Template
  • Custom Activity Template

BPEL Sub-process: Sub-process is introduced in this launch which helps to reduce redundancy. Suppose we need to update database table 3 times in one flow so instead of add 3 different invoke to same BPEL, create sub-process which update the database table and use that sub-process 3 times in that BPEL. There are two types of sub-processes.

  • Standalone sub-process
  • Inline sub-process

Re-sequencing in OSB: In 11g this feature was available in Mediator, in Oracle SOA 12c this features added to service bus also, with the help of this feature we able to process the request message in proper sequence.

Adapter: Coherence, LDAP and cloud adapter are introduced in this release.

Xquery Mapper: In this release Xquery mapper is introduced which provide XQuery support.

Enterprise Service Scheduler: ESS is out of box scheduler. By using this we can schedule the services.

Translate Activity: Translate activity is also introduced which is used for Native to XML and XML to Native transformation.

MDS support for OSB: In 11g version MDS support was not there for OSB but in 12c MDS support is provided for OSB.

Tuesday, January 5, 2016

Introduction to iBatis or MyBatis, An alternative to Hibernate and JDBC

For those who does not know iBatis/MyBatis yet, it is a persistence framework – an alternative to JDBC and Hibernate, available for Java and .NET platforms. I’ve been working with it for almost six years, and I am enjoying it!

The first thing you may notice in this and following articles about iBatis/MyBatis is that I am using both iBatis and Mybatis terms. Why? Until June 2010, iBatis was under Apache license and since then, the framework founders decided to move it to Google Code and they renamed it to MyBatis. The framework is still the same though, it just has a different name now.

What is iBatis/MyBatis ?

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications. MyBatis couples objects with stored procedures or SQL statements using a XML descriptor. Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.To use the MyBatis data mapper, you rely on your own objects, XML, and SQL. There is little to learn that you don’t already know. With the MyBatis Data Mapper, you have the full power of both SQL and stored procedures at your fingertips.

iBATIS is based on the idea that there is a value in relational databases and SQL, and that it is a good idea to embrace the industrywide investment in SQL. We have experiences whereby the database and even the SQL itself have outlived the application source code, and even multiple versions of the source code. In some cases we have seen that an application was rewritten in a different language, but the SQL and database remained largely unchanged.

It is for such reasons that iBATIS does not attempt to hide SQL or avoid SQL. It is a persistence layer framework that instead embraces SQL by making it easier to work with and easier to integrate into modern object-oriented software. These days, there are rumors that databases and SQL threaten our object models, but that does not have to be the case. iBATIS can help to ensure that it is not.


What is iBatis ?

  • A JDBC Framework
  • Developers write SQL, iBATIS executes it using JDBC.
  • No more try/catch/finally/try/catch.
  • An SQL Mapper
  • Automatically maps object properties to prepared statement parameters.
  • Automatically maps result sets to objects.
  • Support for getting rid of N+1 queries.
  • A Transaction Manager
  • iBATIS will provide transaction management for database operations if no other transaction manager is available.
  • iBATIS will use external transaction management (Spring, EJB CMT, etc.) if available.
  • Great integration with Spring, but can also be used without Spring (the Spring folks were early supporters of iBATIS).

What isn’t iBATIS ?

  • An ORM
  • Does not generate SQL
  • Does not have a proprietary query language
  • Does not know about object identity
  • Does not transparently persist objects
  • Does not build an object cache

Essentially, iBatis is a very lightweight persistence solution that gives you most of the semantics of an O/R Mapping toolkit, without all the drama. In other words ,iBATIS strives to ease the development of data-driven applications by abstracting the low-level details involved in database communication (loading a database driver, obtaining and managing connections, managing transaction semantics, etc.), as well as providing higher-level ORM capabilities (automated and configurable mapping of objects to SQL calls, data type conversion management, support for static queries as well as dynamic queries based upon an object’s state, mapping of complex joins to complex object graphs, etc.).

iBATIS simply maps JavaBeans to SQL statements using a very simple XML descriptor. Simplicity is the key advantage of iBATIS over other frameworks and object relational mapping tools.