Tuesday, November 20, 2007

Why Wiki , Blogging & Social Computing

Blogging and wiki is something about the knowledge management, one step further than the information management. There are many ways of knowledge management, blogging and wiki are just one of them.

why we bother to blog or wiki it rather than make a phone call, send a email or book a meeting room? Like it or not, social computing is part of how organization works today and an even larger part of how it will work tomorrow.

Social computing is what happens when people selectively consume, produce, and share online content in new ways. Technologies like blogs, peer-to-peer networking, RSS, wikis, and other collaboration tools continue to grow, evolve, and feed the demand for new methods of interaction. The challenges that you face today as a result of access to online information, software, and communities will intensify, with new challenges emerging over time. To maintain influence in this new world, you must embrace social computing, not fight it. You must become a facilitator for this kind of collaboration and a full member of the social computing community.

Develop your interest in using these forces to do your job more effectively, rather than letting them just make your job more difficult. Instead of seeing this as a new onslaught of back-door paths for unwanted change to reach your organization, adopt a leadership role in using these tools to create a more collaborative and productive organization.

Don't fight this trend, embrace it. You should become an advocate and facilitator for social computing. Make sure people can get what they need within the organization so that they won't have to go elsewhere. Make yourself part of the social computing community, and use that insider advantage to help the organization succeed.

As we take advantage of social computing, don't neglect traditional means of communicating and promoting collaboration. Face-to-face idea sharing remains an important tool in building and nurturing critical relationships, and we should continue to use it for communication.

KM Tool - Wiki

Wikis are tools that allow for collaborative editing and publishing and hence the creation of user generated content. Wikis are another example of social software - software that encourages people to work together.

Wikis are a useful tool when you want people to collaborate and work together on creating a common document, e.g. a project document, a manual, and so on or to work on a common strategy or event, e.g. a conference programme.

In corporate and general use they can be used to create collaborative documents, manuals e.g. WikiHow (a collaborative Manual)

The most obvious and famous example of a wiki is of course Wikipedia, which is an encyclopaedia that has been created by thousands of individuals. Every page in Wikipedia can be edited, which means it is constantly evolving and growing and can be kept up to date.

In the commercial tools market there are a number of enterprise wiki tools available, for example, e.g. Confluence

But there are also a number of free tools, for example:

* MediaWiki is the software used for Wikipedia and the other Wikimedia Foundation websites. Compared to other wikis, it has an excellent range of features and support for high-traffic websites using multiple servers (Wikipedia peaks in the 2500+ requests per second range as of June 2005).
* pbWiki is another hosted service and allows you to set up a wiki very quickly, as are Wikispaces and Wetpaint
* If you are looking for a personal, notepad-type wiki to download onto your own computer, then TiddlyWiki is a useful tool

Reference list

Mediawiki Installation & File Upload HowTO
http://www.washington.edu/computing/web/publishing/mediawiki.html

MediaWiki Comparison Matrix
http://www.wikimatrix.org/show/MediaWiki

How to install PHP and MySQL
http://www.ozzu.com/ftopic56303.html

Wikis - and how to create them quickly and easily

http://c4lpt.co.uk/handbook/wikis.html

Wednesday, November 14, 2007

CVS vs SVN

For CVS, Things like tags and rolling back to older versions is far easier with CVS. And the lack of 'all or nothing' transactions is not a big problem. just add a 'build-****' tag regularly. This makes regressions very easy to track. The 'Revision Graph' in TortoiseCVS is also worth gold.

In CVS, multiple versions can get the same tag, which is logical, but with SVN it would have to 'version' the tags. A tag is a tag in CVS, but it's a folder in SVN.

Operationally speaking, maintenance of repositories and modules are easier in SVN than in CVS, in my opinion.

For development, the Tags & Branches function is very important which CVS is better than SVN. As SVN is actually using different approaches for tagging ( Basically, a tag and a branch, for that matter in SVN is kind of like a copy. However, it's more of a "smart" copy).

CVS Convention and Best Practice
http://tldp.org/REF/CVS-BestPractices/html/index.html

How to install CVS in RedHat Enterprise
http://personal.vsnl.com/sureshms/linuxindex.html
http://www.michael-amorose.com/articles/computers/cvs/6_1.html
http://www.taursys.com/howto/cvs/
http://www.faqs.org/docs/ldev/0130091154_198.htm

CVS Installation for Windows
http://www.devguy.com/fp/cfgmgmt/cvs/cvs_admin_nt.htm

useradd -r -c "CVS user" cvs
passwd cvs
cvs -d /usr/local/cvsroot init
chown -R cvs.cvs /usr/local/cvsroot
cvs -d :pserver:daps@localhost:/usr/local/cvsroot login

CVS Tutorial Link
http://www.cvshome.org/
http://www.developingprogrammers.com/index.php/2005/11/24/cvs-and-subversion-combined-tutorial/

CVS vs SVN reference Link

http://www.pushok.com/soft_svn_vscvs.php
http://www.devmaster.net/forums/showthread.php?t=7394
http://svn.haxx.se/users/archive-2006-10/1382.shtml
http://lists.danga.com/pipermail/mogilefs/2006-June/000336.html
http://wiki.scummvm.org/index.php/CVS_vs_SVN
http://www.gigascale.org/softdevel/faq/27.html
http://users.footprints.net/~kaz/mcvs-svn-comparison.html

Monday, November 5, 2007

SOA, Web Services & BPEL - Tech Forum in Singapore

Recently, i gave a talk and BPEL demo to singapore partners for Oracle BPEL & SOA suites. Introducing them idea of SOA, BPEL and Web Services and how to make use of oracle technology in their applications.

SOA stands for service oriented architecture, it is a architecture model.

Talk about architecture, we need to understand basic building block of each application and system.

Like we build a real house, we use mortar and brick. Every application / system was built with business logic and process. Business process weaves all business logics into one application to achieve business goals. Process and logic weave seamlessly and hard coded into a monolithic application. Like we cook soup, we put all ingredients into water and hard for us to separate each out in the end, by which it reduce reusability of standard process and logics.

In traditional application, when people wanna change the process or integrated with other application / system, especially it is a heterogeneous platform or technology integration, that will be very hard and time-consuming.

For SOA applications, applications also build with process and so-called business logic (have been wrapped into self-contained services). Process and services are loosely coupled, people can easily add or remove services from process, not like traditional applications (process & logic fuse into one). Other than that, people can easily design & program the business process with a advanced IDE. Overall experience for process design and implementation will be a drag-and-drop exercise.

SOA process should be standard, easily extensible and composable. When build an SOA application, we start from building a portfolio of services , follow with well-defined business process to orchestrate services to achieve business goal. This is where BPEL comes in for business process implementation and web service for business service implementation.

Many people equate web services with Service-Oriented Architectures (SOA), but web services are just one element of SOA - they're about service invocation. SOA's scope is broader than just invocation. It's a complete software component architectural model, a way to organize, manage, deploy, discover, and expose software components, and to consume these over the Internet. From the software life-cycle perspective, in addition to the typical software development phases of design, development, and deployment, SOA defines web services-specific phases that include service publishing, discovery, binding and consumption, and management.

Note, SOA != web service+bpel

ESB vs BPEL

Both ESB and BPEL can be used for SOA implementation.

ESB (Enterprise Service Bus) implement messaging to enable services to be integrated in a message-based paradigm: both synchronous and asynchronous styles. ESB moves data via different adaptors (WebServices, FTP,File,JDBC etc) and protocols (HTTP,JMS) and enriches and transform data using XSL & domain value mapping lookups.

Oracle BPEL provides a comprehensive, standards-based and easy to use solution for creating, deploying, and managing cross-application business processes with both automated and human workflow steps.

ESB is good for routing messages to multiple destinations. It is also good for doing transformations that have little to no business rules. The footprint is much smaller and incurs minimal overhead therefore the performance is much better.

BPEL is used for bringing together multiple services. There is much more functionality and allows implementation of complex business logic.

• BPEL data transformations enrich and perform complex changes whereas ESB perform only simple transformations.
BPEL can use Business rules, Human Workflow and Notifications, exception handling can be done in BPEL.

Use ESB when you want a really low cost solution, Only need connectivity, simple transformations and routing.

BPEL is primarily used for servies orchestration, data enrichment and human interaction.


Use BPEL+ESB when, You need to code complex business logic, integration with Workflow, complex transforms potentially involving the database or having long running processes which may or may not be stateful.

With an appropriately layered SOA architecture, one would look at ESB as a repository of services that BPEL orchestrates. At deployment time, this layered approach provides you the flexibility to dedicate servers to individual tiers (BPEL and ESB) and thereby maximize the resource usage for your particular use case.

Friday, November 2, 2007

Io exception: The Network Adapter could not establish the connection

Recently, i did an RAC validation with our oracle partner and encountered this weird exception called "Io exception: The Network Adapter could not establish the connection".

Two client machine were running same java code (using jdbc thin driver & oracle datasource) in the same LAN as RAC servers, but they came out with differen behaviour. One could connect to RAC database, the other one always got io exception mentioned above.

The only difference between two machines was one of clients' host file having rac ip & hostname mapping entry, which is able to connect to oracle rac db.

Something weird is that all db clients and servers were actually sitting in the same LAN. I could ping and telnet db rac with rac ip address (virtual and real ) from client machines, but when i use ip address in the java class to lookup the db connection, i could not get connected to db if rac ip & hostname mapping entries were not available in the client host file.

Here is the sample Codes for RAC FCF connection:

OracleDataSource ods = new OracleDataSource();
OracleConnectionCacheManager occm = null;
ods.setUser("user-name");
ods.setPassword("password");
String cacheName = "cache";
String dbURL="jdbc:oracle:thin:@"+
"(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)" +
"(ADDRESS=(PROTOCOL=TCP)" +
"(HOST=rac1-vip-address)(PORT=1521))" +
"(ADDRESS=(PROTOCOL=TCP)" +
"(HOST=rac2-vip-address)(PORT=1521)))" +
"(CONNECT_DATA=(SERVICE_NAME=orcl.abc.com)))";
ods.setURL(dbURL); System.out.println("Url=" + dbURL ); ods.setConnectionCachingEnabled(true);
Properties prop = new Properties();
prop.setProperty("MinLimit", "5");
prop.setProperty("MaxLimit", "40");
prop.setProperty("InitialLimit", "10");
prop.put (oracle.net.ns.SQLnetDef.TCP_CONNTIMEOUT_STR,"" + (5000)); // 5000ms ods.setConnectionCacheProperties(prop);
ods.setFastConnectionFailoverEnabled(true);
ods.setONSConfiguration("nodes=rac1-ip-address:6200,rac2-ip-address:6200"); ods.setConnectionCacheName(cacheName);
//occm = OracleConnectionCacheManager.getConnectionCacheManagerInstance();
Connection conn = ods.getConnection();

It looks somewhere JDBC driver looking up db connection with rac hostname instead of ip address and I have to put the rac ip & hostname mapping in the client host file for jdbc driver to resolve them.

Wednesday, October 31, 2007

Web service security & clustering

The Oracle Web Services Manager (OWSM) secures Web services by using policy enforcement points. It has several types of policy enforcement points: Gateways, Web service client agents (client-Agents), and Web service agent (server-Agents). These policies are created, managed, and located in the OWSM Policy Manager, which is a centralized policy store.

An example policy could be to require authentication and authorization to all services. This policy is centrally stored in the Policy Manager, and is consumed by all the agents and gateways deployed in the SOA.

Gateway Use Case

An Internet facing Web service can be protected by inserting a gateway in front of it. A gateway is similar to a web based proxy, it is a choke point where all Web service traffic is forced through. Gateways are SOAP/XML intermediaries that enforce Web services policies while intermediating Web services traffic between clients and services.

This would be done using a WS-Security Username Token for authentication. Based on the credentials, the gateway should be able to authenticate and authorize access to the service.

Alternatively, WS-Security SAML Token can be applied when business partners expose business processes to each other within a secure context.

Agent Use Case

A Web service agent is another useful policy enforcement point. Agents (client-Agents and server- Agents) are SOAP interceptors that enforce Web services policies from within the same Web application.

Agents execute in the same process as the application, while Gateways run on separate processes and possibly on different servers. Gateways can manage services from multiple applications while agents control services belonging to the single application.

Web service is not exposed over the internet, then using agents is a viable option to secure the business process. There can be other reasons for using agents. For example, if one wants end-to-end security where the data is secured from the beginning to the end of the process.


OASIS WSS UsernameToken Profile (User name and password)

OASIS WSS X509 Token Profile 1.1 (certificate based)

OASIS WSS SAML Token Profile 1.1 (Xml accertation token from accertation server for sso)

OASIS WSS SWA Profile 1.1


Reference:

Web Services Security, Part 1

Web Services Security, Part 2

Web Services Security, Part 3

Apache WSS4J 1.1.0 Released

Securing Web Services and the Java WSDP 1.5


Tutorial

Securing Web Services Using the SAML or UserNameToken Profiles

Clustering and Securing Web Applications: A Tutorial


Web Services Security (2003)

http://www.xml.com/pub/a/ws/2003/03/04/security.html
http://www.xml.com/pub/a/ws/2003/04/01/security.html


Oracle TAF & FCF

Transparent Application Failover (TAF)

Transparent Application Failover (TAF) is a feature of the Java Database Connectivity (JDBC) Oracle Call Interface (OCI) driver. It enables the application to automatically reconnect to a database, if the database instance to which the connection is made fails. In this case, the active transactions roll back.

Transparent Application Failover (TAF) is a client-side feature that allows for clients to reconnect to surviving databases in the event of a failure of a database instance. Notifications are used by the server to trigger TAF callbacks on the client-side.

TAF is configured using either client-side specified TNS connect string or using server-side service attributes. However, if both methods are used to configure TAF, the server-side service attributes will supersede the client-side settings. The server-side service attributes are the preferred way to set up TAF.

TAF can operate in one of two modes, Session Failover and Select Failover. Session Failover will recreate lost connections and sessions. Select Failover will replay queries that were in progress.

Transparent Application Failover
Configuring Transparent Application Failover

Fast Connection Failover (FCF)

Fast Connection Failover offers a driver-independent way for your Java Database Connectivity (JDBC) application to take advantage of the connection failover facilities offered by Oracle Database 10g. The Fast Connection Failover mechanism depends on the implicit connection cache feature. As a result, for Fast Connection Failover to be available, implicit connection caching must be enabled.

FCF vs TAF

TAF is always active and does not have to be set, it does not work with the OCI Connection Pool.
Oracle recommends not to use TAF and Fast Connection Failover in the same application

Friday, October 26, 2007

Web Services Protocol Stack

You may hear web services for many years and already get some ideas of it, but always get confused and lost in the set of protocol and technology in use and not sure how they are related to each other in the picture.

Here, i would like to give another explanation of them from underlying protocol stack in use for web service so that you can organized, relate them properly in mind.

The Web service protocol stack is a collection of computer networking protocols that are used to define, locate, implement, and make Web services interact with each other. The Web service protocol stack mainly comprises four areas (source:wikipedia):

* Transport Protocol: responsible for transporting messages between network applications and includes protocols such as HTTP(s), SMTP, FTP, as well as the more recent Blocks Extensible Exchange Protocol (BEEP). Now, most common protocol in use is HTTP(S).

* Messaging Protocol: responsible for encoding messages in a common XML format so that they can be understood at either end of a network connection. Currently, this area includes such protocols as XML-RPC, WS-Addressing, REST and SOAP, which is most common one in use today.

* Description Protocol: used for describing the public interface to a specific web service. The WSDL interface format is typically used for this purpose.

* Discovery Protocol: centralizes services into a common registry such that network web services can publish their location and description, and makes it easy to discover what services are available on the network. At present, the UDDI API is normally used for service discovery.

Web service protocol stack also includes a whole range of recently defined protocols: BPEL, SOAP-DSIG.

In general terms, a web service is a software component or service that has been published on the World Wide Web in one of several particular ways, but industry tends to use the term web services more specifically, to describe services that are exposed using SOAP, an XML-based message encoding that is typically transported using HTTP.

XML-RPC

XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism. XML-RPC is a very simple protocol, defining only a handful of data types and commands, and the entire description can be printed on two pages of paper. Some people still prefer XML-RPC to SOAP because of its simplicity, minimalism, and ease of use. (source:wikipedia)

SOAP

SOAP is a protocol for exchanging XML-based messages over computer networks, normally using HTTP/HTTPS. SOAP forms the foundation layer of the Web services stack, providing a basic messaging framework so that more abstract layers can build on.

There are several different types of messaging patterns in SOAP, but by far the most common is the Remote Procedure Call (RPC) pattern, in which one network node (the client) sends a request message to another node (the server) and the server immediately sends a response message to the client.

SOAP is the successor of XML-RPC, though it borrows its transport and interaction neutrality and the envelope/header/body from elsewhere, probably from WDDX (source:wikipedia).

A SOAP message is an ordinary XML document containing the following elements:

* A required Envelope element that identifies the XML document as a SOAP message
* An optional Header element that contains header information
* A required Body element that contains call and response information
* An optional Fault element that provides information about errors that occurred while processing the message

All the elements above are declared in the default namespace for the SOAP envelope (source: w3schools)

WSDL

The Web Services Description Language (WSDL) is an XML-based language that provides a model for describing Web services.The current version of the specification is the 2.0. The WSDL defines services as collections of network endpoints, or ports. WSDL specification provides an XML format for documents for this purpose.A port is defined by associating a network address with a reusable binding, and a collection of ports define a service.

WSDL is often used in combination with SOAP and XML Schema to provide web services over the Internet. A client program connecting to a web service can read the WSDL to determine what functions are available on the server. Any special datatypes used are embedded in the WSDL file in the form of XML Schema. The client can then use SOAP to actually call one of the functions listed in the WSDL.WSDL 1.2 was renamed WSDL 2.0 because of its substantial differences from WSDL 1.1. By accepting binding to all the HTTP request methods (not only GET and POST as in version 1.1) WSDL 2.0 specification offers a better support for RESTful web services, much simpler to implement by beginners. (source:wikipedia)

A WSDL 1.1 document uses the following elements in the definition of network services:

* Types– a container for data type definitions using some type system (such as XSD).
* Message– an abstract, typed definition of the data being communicated.
* Operation– an abstract description of an action supported by the service.
* Port Type–an abstract set of operations supported by one or more endpoints.
* Binding– a concrete protocol and data format specification for a (not more than one) particular port type.
* Port– a single endpoint defined as a combination of a binding (not more than one) and a network address.
* Service– a collection of related endpoints (port).

WSDL 2.0 is different from WSDL 1.1 check out the example of a structured WSDL 2.0 document from here.

UDDI

Universal Description, Discovery and Integration (UDDI) is a platform-independent, XML-based registry for businesses worldwide to list themselves on the Internet. UDDI is a cross-industry effort driven by all major platform and software providers like Dell, Fujitsu, HP, Hitachi, IBM, Intel, Microsoft, Oracle, SAP, and Sun, as well as a large community of marketplace operators, and e-business leaders.

JAX-RPC
Check out my previous two posts (1|2) in this blog.

JAXR

Java API for XML Registries (JAXR) defines a standard API for Java platform applications to access and programmatically interact with various kinds of metadata registries. JAXR provides a uniform and standard Java API for accessing different kinds of XML-based metadata registry.

Current implementations of JAXR support ebXML Registry version 2.0, and UDDI version 2.0. More such registries could be defined in the future.

The JAXR API insulates application code from the underlying registry mechanism. When writing a JAXR based client to browse or populate a registry, the code does not have to change if the registry changes, for instance from UDDI to ebXML.

WS-I
The WS-I Basic Profile (official abbreviation is BP), a specification from the Web Services Interoperability industry consortium (WS-I), provides interoperability guidance for core Web Services specifications such as SOAP, WSDL, and UDDI. The profile uses Web Services Description Language (WSDL) to enable the description of services as sets of endpoints operating on messages. BP complied web service means smooth internal operability (messaging, description and registry) between web services regardless of underlying implementation.

Thursday, October 25, 2007

Open Source Tool for JDBC Debugging and Monitoring

P6Spy is a open source framework to intercept and debug JDBC interaction with a database and optionally modify database statements. It's a wrapper of all JDBC elements ( Connection, PreparedStatement, ResultSet... ) and it has a powerful feature in order to log all informations about those interactions. P6Spy includes P6Log, an application that intercepts and logs the database statements of any application that uses JDBC.

This application is particularly useful for developers to monitor the SQL statements produced by EJB servers, enabling the developer to write code that achieves maximum efficiency on the server.

You can also use it together with spring and hibernate for performance tuning as well.

Reference List:

P6Spy

P6Spy Official Home

Integrate P6Spy with Spring

Improving Hibernate's Performance

P6Spy released: automatic logging of your database/EJB queries

´