<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;A0YHQHY_fSp7ImA9WhRbEEg.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761</id><updated>2012-01-31T17:18:51.845-08:00</updated><category term="swfloader" /><category term="CTXCAT" /><category term="Command Editor" /><category term="JPA" /><category term="Bounded Task Flow" /><category term="debugging tips" /><category term="HTTP Basic Authentication" /><category term="OEM Grid Control" /><category term="Table Comment" /><category term="ADF-based Transactional Application Taskflows" /><category term="Rss and atOM utilitiEs" /><category term="Remote Debugging" /><category term="Import" /><category term="Method Binding" /><category term="java.lang.OutOfMemoryError" /><category term="DataSource" /><category term="ADF BC Service" /><category term="Expression Builder" /><category term="JAPE" /><category term="Deadlock" /><category term="WebLogic Server" /><category term="Diagnostic" /><category term="Page Definition File" /><category term="Oracle Warehouse Builder" /><category term="openMainTask" /><category term="Property Chain Axiom" /><category term="Flex Builder" /><category term="Savepoint" /><category term="Flex" /><category term="security domain" /><category term="Backing Bean" /><category term="Oracle Fusion Web Applications" /><category term="Classloader" /><category term="XML Schema" /><category term="JDeveloper 11g" /><category term="flash player security" /><category term="Coffman Conditions" /><category term="FireFox" /><category term="WSDL Bining" /><category term="Page Flow Scope" /><category term="Install Manifest" /><category term="Application Module" /><category term="Generation Space" /><category term="RDF" /><category term="Java Classloading" /><category term="IDE Connection" /><category term="Subversion" /><category term="Export Release Build" /><category term="Eclipse Memory Analyzer" /><category term="Microsoft Excel" /><category term="WebCenter Framework" /><category term="Forums" /><category term="SQL-Independence" /><category term="JDBC DataSource" /><category term="Java Annotation Patterns Engine" /><category term="Java Heap Space" /><category term="Web Service Proxy" /><category term="Deer" /><category term="Binding Style" /><category term="New 7 Wonders of Nature" /><category term="Binding Container" /><category term="Yushan" /><category term="Trade-Offs" /><category term="Oracle Enterprise Manager" /><category term="Ontology" /><category term="svn:keywords" /><category term="Oracle Database Semantic Technologies" /><category term="Layout" /><category term="View Criteria" /><category term="endpointURI" /><category term="Command Creation" /><category term="swf loading" /><category term="Eclipse" /><category term="ADF Business Components" /><category term="UML Class Diagram" /><category term="Garbage Collection" /><category term="DriverManager" /><category term="Plug-in" /><category term="Job Interview" /><category term="User's Perspective" /><category term="Input Text" /><category term="Volume Rendering" /><category term="FlexBuilder" /><category term="Installation Guide" /><category term="Data Control Flow" /><category term="Scientific Visualization" /><category term="MapReduce" /><category term="Star Schema" /><category term="UI Manager" /><category term="Overylay" /><category term="URI" /><category term="Botswana" /><category term="BindingContext" /><category term="Debugging Tools" /><category term="Named Bind Variable" /><category term="createViewCriteria" /><category term="WebService Class" /><category term="Videos" /><category term="Task Flow" /><category term="Resource Palette" /><category term="Resources" /><category term="CTXRULE" /><category term="Who Scare Who" /><category term="Database Navigator" /><category term="Oracle JDBC Programming" /><category term="JAPE Grammar" /><category term="Cube and Dimensions" /><category term="Oracle Text" /><category term="Smart Keyword" /><category term="Fusion Web Applications" /><category term="openSubTask" /><category term="getViewCriteria" /><category term="GATE Embedded" /><category term="Hotspot VM" /><category term="Preferences" /><category term="Transient Attribute" /><category term="Import Project" /><category term="Offline Database" /><category term="WebCenter" /><category term="RSS Modules" /><category term="Normalized URI" /><category term="Text Index" /><category term="Action Binding" /><category term="Recent Items" /><category term="Oracle ADF 11g" /><category term="JPA API" /><category term="Health and Wellness" /><category term="Binding Context" /><category term="Keyword Substitution" /><category term="System Properties" /><category term="Managed Bean" /><category term="Subsclipse" /><category term="Oracle WebLogic Server" /><category term="CTXXPATH" /><category term="Expert SQL Mode" /><category term="Health Hazards" /><category term="Juneau" /><category term="Sunrises" /><category term="Integrated WebLogic Server" /><category term="af:commandLink" /><category term="Optimistic Concurrency Control" /><category term="WebCenter Services" /><category term="security sandbox" /><category term="JPQL" /><category term="Data Visualization Tools" /><category term="Design Pattern" /><category term="debugging tricks" /><category term="Orcle Semantic Technologies" /><category term="Choice List" /><category term="moduleloader" /><category term="ADF Faces" /><category term="Namespace Declaration" /><category term="Semantic Technologies" /><category term="Jupiter" /><category term="CPU Profiler" /><category term="Duplicate Entry Detection" /><category term="hashCode()" /><category term="WLS" /><category term="SQL Flavor" /><category term="Volatile Keyword" /><category term="af:table" /><category term="Chrome Manifest" /><category term="Declarative SQL Mode" /><category term="General Architecture for Text Engineering" /><category term="Unbounded Task Flow" /><category term="Transducer" /><category term="Oracle Database 11g" /><category term="svn cleanup" /><category term="Travel" /><category term="sandbox types" /><category term="RDF Triple" /><category term="CREOLE Resources" /><category term="Laser Printer" /><category term="JPA Entities" /><category term="Award-Winning Singer" /><category term="Data Warehouse" /><category term="Africa" /><category term="mm.cfg" /><category term="Blogs" /><category term="WebCenter Spaces" /><category term="item renderer" /><category term="Adobe" /><category term="createPreparedStatement" /><category term="Toxic Dust" /><category term="OWL2RL" /><category term="Memory Scope" /><category term="JPDA" /><category term="HPROF" /><category term="adt" /><category term="UI Shell Template" /><category term="Version Control" /><category term="ADF Model" /><category term="Duplicate Item Detection" /><category term="View Object Attribute" /><category term="Dog" /><category term="Memory Profiler" /><category term="Oracle Application Express" /><category term="XML" /><category term="Adobe AIR" /><category term="Gold Fish Example" /><category term="Data Model Design" /><category term="Book View" /><category term="GATE Plugins" /><category term="HTTP Analyzer" /><category term="URL Syntax" /><category term="Split Editor Window" /><category term="ClassFactory" /><category term="Comparision" /><category term="equals()" /><category term="Fusion Applications" /><category term="Command Entry" /><category term="air security model" /><category term="Business Management Service" /><category term="application domain" /><category term="Java Object" /><category term="Oracle WebCenter 11g" /><category term="Enterprise 2.0" /><category term="Jade Mountain" /><category term="Reusable Components" /><category term="Funny Video" /><category term="Introduction" /><category term="Graph" /><category term="Adobe Flex" /><category term="OWLPrime" /><category term="BindingContainer" /><category term="Mt. Roberts" /><category term="Oracle SOA Suite" /><category term="Dependency Injection" /><category term="Comparison" /><category term="Alaska Tour" /><category term="Sea of Clouds" /><category term="Stroke Symptoms" /><category term="Method Builder" /><category term="already-locked" /><category term="Addons" /><category term="JDBC URL" /><category term="Garbage Collector" /><category term="WSDL" /><category term="Data Controls" /><category term="Use Cases" /><category term="ADF Library JAR" /><category term="Hadoop" /><category term="GATE" /><category term="Database Diagram" /><category term="Calculated Attribute" /><category term="ROME" /><category term="Book Review" /><category term="closeSubTask" /><category term="Sub-Flow" /><category term="Atom Modules" /><category term="Application Resources" /><category term="Portal and Portlet" /><category term="ADF Controller Transaction" /><category term="Java Memory Model" /><category term="Close Encounter" /><category term="Java" /><category term="Web 2.0" /><category term="SDO" /><category term="Web Service" /><category term="Filtering Data" /><category term="Nominjin" /><category term="Social Software" /><category term="Debug Player" /><category term="Oracle JDeveloper 11g" /><category term="Database Connection" /><category term="Adobe Flash Player" /><category term="Plugin Mechanism" /><category term="Java VM Options" /><category term="Ubiquity" /><category term="Task Flow Transaction" /><category term="Language Identification" /><category term="Synchronization" /><category term="EclipseLink" /><category term="Normal SQL Mode" /><category term="closeMainTask" /><category term="Yushan National Park" /><category term="SQL-Calculated Attribute" /><category term="Application Loading" /><category term="OWB" /><category term="Subquery" /><category term="ADF Business Component" /><category term="Interview Question" /><category term="Photo Safari" /><category term="Column Comment" /><category term="Vegetarianism Promotion" /><category term="tram ride" /><category term="Songwriter" /><title>Xml and More</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://xmlandmore.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>91</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/LearnFromNoahsArk" /><feedburner:info uri="learnfromnoahsark" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;Ck8EQns6cCp7ImA9WhRUGEQ.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-972574949677469469</id><published>2012-01-29T16:17:00.000-08:00</published><updated>2012-01-29T18:33:23.518-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-29T18:33:23.518-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Deadlock" /><category scheme="http://www.blogger.com/atom/ns#" term="Optimistic Concurrency Control" /><category scheme="http://www.blogger.com/atom/ns#" term="Coffman Conditions" /><title>How to Avoid Deadlocks</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GW1Ln9kaVI8HfWx6Hvi-SQn4Nfc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GW1Ln9kaVI8HfWx6Hvi-SQn4Nfc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GW1Ln9kaVI8HfWx6Hvi-SQn4Nfc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GW1Ln9kaVI8HfWx6Hvi-SQn4Nfc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="docTextHighlight"&gt;&lt;b&gt;Deadlock&lt;/b&gt;&lt;/span&gt;&lt;a href="http://www.blogger.com/" name="by the"&gt;&lt;/a&gt; can be illustrated by the classic &lt;b&gt;dining philosophers problem&lt;/b&gt;&lt;sup&gt;[1]&lt;/sup&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
In an operating system, a deadlock&lt;sup&gt;[2]&lt;/sup&gt; is a situation which occurs when a process enters a waiting state because a resource requested by it is being held by another waiting process, which in turn is waiting for another resource. If a process is unable to change its state indefinitely because the resources requested by it are being used by other waiting process, then the system is said to be in a deadlock.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
In Java programming, deadlocks may manifest themselves where multiple threads wait forever due to a cyclic locking dependency.&amp;nbsp; For example, when thread &lt;span class="docEmphasis" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;A&lt;/span&gt; holds lock &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="docEmphasis"&gt;L&lt;/span&gt; &lt;/span&gt;and tries to acquire lock &lt;span class="docEmphasis" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;M&lt;/span&gt;, but at the same time thread &lt;span class="docEmphasis" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;B&lt;/span&gt; holds &lt;span class="docEmphasis" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;M&lt;/span&gt; and tries to acquire &lt;span class="docEmphasis" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;L&lt;/span&gt;, &lt;span class="docEmphasis"&gt;both&lt;/span&gt;&lt;a href="http://www.blogger.com/" name="of"&gt;&lt;/a&gt; threads will wait forever.&amp;nbsp; Just as threads can deadlock when they are each waiting for a lock that the other holds and will not release, they can also deadlock when waiting for resources. Comparing to deadlock, &lt;a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/starvelive.html" target="_blank"&gt;starvation and livelock&lt;/a&gt; are much less common a problem, but are still problems that every designer of concurrent software is likely to encounter. Java applications do not recover from deadlock, so it is worthwhile to ensure that your design precludes the conditions that could cause it&lt;sup&gt;[6]&lt;/sup&gt;. &lt;br /&gt;
&lt;br /&gt;
In this article, we will discuss some threading best practices to avoid deadlocks.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Necessary Conditions&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A deadlock situation can arise only if all of the following conditions hold simultaneously in a system:&lt;sup&gt;[3]&lt;/sup&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Mutual Exclusion&lt;/b&gt;: At least, one resource must be non-shareable.&amp;nbsp; Only one process can use the resource at any given instant of time.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Hold and Wait&lt;/b&gt;: A process is currently holding at least one resource and requesting additional resources which are being held by other processes.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;No Preemption&lt;/b&gt;: The operation system can de-allocate resources once they have been allocated. They must released by the holding process voluntarily.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Circular Wait&lt;/b&gt;: A process waiting for a resource which is being held by another process, which in turn is waiting for another process to release a resource. &lt;/li&gt;
&lt;/ol&gt;
Unfulfillment of any of these conditions is enough to preclude a deadlock from occurring.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;How to Avoid Deadlocks&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;b&gt;&lt;u&gt;Never cede control to the client within a synchronized method or block&lt;/u&gt;&lt;sup&gt;[4]&lt;/sup&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Invoking an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;alien method&lt;/span&gt; with a lock held is asking for liveness trouble. The alien method might acquire other locks (risking deadlock) or block for an unexpectedly long time, stalling other threads that need the lock you hold.&lt;br /&gt;
&lt;br /&gt;
In other words, inside a synchronized region, do not invoke a method that is designed to be overridden, or one provided by a client in the form of a function object (i.e., object references used to implement the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Strategy&lt;/span&gt; pattern).&amp;nbsp; The class has no knowledge of what the alien method does and has no control over it. If you do call an alien method from within a synchronized region, you open the opportunities of deadlocks by allowing the following conditions to hold:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Hold and Wait &lt;/li&gt;
&lt;li&gt;Circular Wait&lt;/li&gt;
&lt;/ul&gt;
Because you call the alien method from a shynchronized region, it holds a lock. If this alien method is overriden and it engages the services of another thread to do the deed,&amp;nbsp; &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Hold and Wait&lt;/span&gt; condition will be established.&amp;nbsp; Given another counterpart of Hold-and-Wait, it can possibly form a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Circular Wait&lt;/span&gt; condition.&lt;br /&gt;
&lt;br /&gt;
Calling a method with no locks held is called an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;open call&lt;/span&gt;&lt;sup&gt;[6]&lt;/sup&gt;, and classes that rely on open calls are more well-behaved and composable than classes that make calls with locks held. &lt;br /&gt;
&lt;br /&gt;
More generally, try to limit the amount of work that you do from within synchronized regions. When you are designing a mutable class, think about whether it should do its own synchronization. Synchronize your class internally only if there is a good reason to do so, and document your decision clearly. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Ensure that resources are always acquired in some well-defined order&lt;/u&gt;&lt;sup&gt;[7]&lt;/sup&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Deadlocks can be avoided&amp;nbsp;by assigning a partial order to the resources, and establishing the convention that all resources will be requested in order, and released in reverse order, and that no two resources unrelated by order will ever be used by a single unit of work at the same time.&amp;nbsp; This solution to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;dining philosophers problem&lt;/span&gt; was originally proposed by &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Dijkstra&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
There are different approaches to enforce a partial order to the resources:&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;If resources are static and known in advanced &lt;ul&gt;
&lt;li&gt;Just stick to a programming policy (i.e., all programmers apply the policy of acquiring the locks in some well-defined order)&lt;/li&gt;
&lt;li&gt;Provide a method that &lt;i&gt;combines&lt;/i&gt; acquisition and release of the multiple locks in the correct way (see &lt;a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/newlocks.html" target="_blank"&gt;here&lt;/a&gt; for an example)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If resources are not known in advanced or acquired dynamically &lt;ul&gt;
&lt;li&gt;We have to explicitly define some way of ordering them. For example, &lt;ul&gt;
&lt;li&gt;If locking will only exist for the lifetime of the application &lt;ul&gt;
&lt;li&gt;We can use the &lt;i&gt;identity hash code&lt;/i&gt; (&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;System.identityHashCode(r)&lt;/span&gt;) of the two objects. &lt;/li&gt;
&lt;li&gt;In the rare case that two objects have the same hash code, we must use an arbitrary means of ordering the lock acquisitions, and this reintroduces the possibility of deadlock. To prevent inconsistent lock ordering in this case, a third &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;tie breaking&lt;/span&gt; lock can be used&lt;sup&gt;[6]&lt;/sup&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;b&gt;&lt;u&gt;Removing the mutual exclusion condition&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Removing the mutual exclusion condition means that no process will have exclusive access to a resource. This proves impossible for resources that cannot be spooled. But even with spooled resources, deadlock could still occur. Algorithms that avoid mutual exclusion are called &lt;a href="http://en.wikipedia.org/wiki/Non-blocking_synchronization"&gt;non-blocking synchronization&lt;/a&gt; algorithms.&lt;br /&gt;
&lt;br /&gt;
For example, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;optimistic concurrency control&lt;/span&gt;&lt;sup&gt;[9] &lt;/sup&gt;uses a pair of &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;consistency markers&lt;/span&gt; in the data structure. Processes reading the data structure first read one consistency marker, then read the relevant data into an internal buffer, then read the other marker, and then compare the markers. The data is consistent if the two markers are identical. Markers may be non-identical when the read is interrupted by another process updating the data structure. In such a case, the process discards the data in the internal buffer and tries again.&lt;br /&gt;
&lt;br /&gt;
Finally, immutability is great for multi-threading. Instances of immutable class appear constant. Therefore, no external synchronization is necessary. Examples include &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;String&lt;/span&gt;, &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Long&lt;/span&gt;, and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;BigInteger&lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Using timed lock acquisition to acquire multiple locks&lt;/u&gt;&lt;sup&gt;[6]&lt;/sup&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Another technique for detecting and recovering from deadlocks is to use the timed &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;tryLock&lt;/span&gt; feature of the explicit Lock classes instead of intrinsic locking. &lt;br /&gt;
&lt;br /&gt;
If a lock acquisition times out, you can release the locks, back off and wait for a while, and try again, possibly clearing the deadlock condition and allowing the program to recover. However, this technique works only when the two locks are acquired together; if multiple locks are acquired due to the nesting of method calls, you cannot just release the outer lock, even if you know you hold it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We conclude this article by quoting Goetz et al.&lt;sup&gt;[6]&lt;/sup&gt;:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
Like many other concurrency hazards, deadlocks rarely manifest themselves immediately. The fact that a class has a potential deadlock doesn’t mean that it ever will deadlock, just that it can. When deadlocks do manifest themselves, it is often at the worst possible time—under heavy production load.&lt;/blockquote&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;References&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Dining_philosophers_problem#Resource_hierarchy_solution" target="_blank"&gt;Dining philosophers problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Deadlock" target="_blank"&gt;Deadlock&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Advanced Synchronization in Java Threads&lt;/i&gt; by Scott Oaks and Henry Wong&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Effective Java&lt;/i&gt; by Joshua Block&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/660621/threading-best-practices" target="_blank"&gt;Threading Best Practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Java Concurrency in Practice&lt;/i&gt; by Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes and Doug Lea&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/threads/deadlock.shtml" target="_blank"&gt;Deadlock Tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The Java Tutorial (&lt;a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/index.html" target="_blank"&gt;Concurrency&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Optimistic_concurrency_control" target="_blank"&gt;Optimistic concurrency control&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Concurrency: State Models &amp;amp; Java Programs (2nd Edition)&lt;/i&gt;, by Jeff Magee and Jeff Kramer. &lt;/li&gt;
&lt;li&gt;&lt;a class="OutsideLink" href="http://sourceforge.net/projects/javaconcurrenta/" target="_blank"&gt;&lt;i&gt;Java Concurrent Animated&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-972574949677469469?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/f8hV63hcyaA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/972574949677469469/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=972574949677469469" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/972574949677469469?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/972574949677469469?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/f8hV63hcyaA/how-to-avoid-deadlocks.html" title="How to Avoid Deadlocks" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/how-to-avoid-deadlocks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcNRX44fCp7ImA9WhRUGEw.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-5118373913214858807</id><published>2012-01-22T20:45:00.000-08:00</published><updated>2012-01-28T22:04:54.034-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-28T22:04:54.034-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Synchronization" /><category scheme="http://www.blogger.com/atom/ns#" term="Java Memory Model" /><category scheme="http://www.blogger.com/atom/ns#" term="Volatile Keyword" /><title>Volatile Keyword in Java</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VeiWZMvv5VwbxYi1-MDUpHTmwrY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VeiWZMvv5VwbxYi1-MDUpHTmwrY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VeiWZMvv5VwbxYi1-MDUpHTmwrY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VeiWZMvv5VwbxYi1-MDUpHTmwrY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Multithreading is one of the most important software technologies for boosting the performance and scalability of all types of software.&amp;nbsp;&amp;nbsp; However, it comes at a prise&lt;span dir="ltr" id="sites-page-title"&gt;—&lt;/span&gt;complexity.&amp;nbsp; The pain of concurrent programming can be alleviated by a framework like &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Hadoop&lt;/span&gt;.&amp;nbsp; However, as a Java programmer using threads, you need to deal with three interwined issues:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Atomicity&lt;/b&gt; &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Visibility&lt;/b&gt; &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Ordering&lt;/b&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Working Memory&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Java Memory Model&lt;/span&gt; defines an abstract relation between threads and main memory. Every thread is defined to have a working memory (an abstraction of caches and registers) in which to store values. The model guarantees a few properties surrounding the interactions of instruction sequences corresponding to methods and memory cells corresponding to fields. Most rules are phrased in terms of when values must be transferred between the main memory and per-thread working memory.&lt;br /&gt;
&lt;br /&gt;
Common variables such as instance fields, static fields and array elements in heap memory can be shared between threads.&amp;nbsp; At any time, these variables can be kept in one of the following locations:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Register&lt;/li&gt;
&lt;li&gt;L1-L3 caches&lt;/li&gt;
&lt;li&gt;Main memory&lt;/li&gt;
&lt;li&gt;Hard disk (passivation and activation of Java Beans; paging or swapping)&lt;/li&gt;
&lt;/ul&gt;
When multiple threads are all running unsynchronized code that reads and writes common variables, then:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;Arbitrary interleavings&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;Atomicity failures&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;Race conditions&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;Visibility failures &lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
may result in execution patterns. &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Atomicity&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
The language specification guarantees that reading or writing a single variable is atomic unless the variable is of type &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;long&lt;/span&gt; or &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;double&lt;/span&gt;.&amp;nbsp; This includes fields serving as references to other objects.&amp;nbsp; In other words, this implies that every thread accessing a field of any type except &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;long&lt;/span&gt; or &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;double &lt;/span&gt;will read its current value before continuing, instead of (potentially) using a cached value. This atomicity guarantee can be extended to &lt;span style="font-family: Courier New;"&gt;longs&lt;/span&gt; or &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;doubles&lt;/span&gt;, if you declare them volatile.&amp;nbsp; We'll discuss this more later. &lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Visibility&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Visibility&lt;/b&gt; discusses under what conditions the effects of one thread are visible to another. The effects of interest here are writes to fields, as seen via reads of those fields.&amp;nbsp; While the atomicity guarantee ensures that a thread will not see a random value when reading atomic data, it does not gurantee that a value written by one thread will be visible to another: &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Synchronization&lt;/span&gt; is required for reliable communication between threads as well as for mutual exclusion&lt;sup&gt;[8]&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
If a variable is declared &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;volatile&lt;/span&gt;, this signals that the variable will be accessed by multiple threads, and also gives visibility guarantees.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Ordering&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;Ordering&lt;/b&gt; describes under what conditions the effects of operations can appear out of order to any given thread. The main ordering issues surround reads and writes associated with sequences of assignment statements. &lt;/div&gt;
&lt;br /&gt;
If a program has no &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;data races&lt;/span&gt;, then all executions of the program will appear to be sequentially consistent.&amp;nbsp; If &lt;a href="http://java.sun.com/docs/books/jls/download/langspec-3.0.pdf" target="_blank"&gt;JLS&lt;/a&gt; were to use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sequential consistency&lt;/span&gt; as its memory model, many of the compiler and processor optimizations would be illegal.&amp;nbsp;&amp;nbsp;For example, JLS allows the following statements to be reordered:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ppZiuGXl_EM/Txx_-S2sw4I/AAAAAAAAArM/sMObbh17voA/s1600/Reordering.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="302" nfa="true" src="http://2.bp.blogspot.com/-ppZiuGXl_EM/Txx_-S2sw4I/AAAAAAAAArM/sMObbh17voA/s640/Reordering.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
This provides essential flexibility for compilers and machines. Exploitation of such opportunities (via pipelined superscalar CPUs, multilevel caches, load/store balancing, interprocedural register allocation, and so on) is responsible for a significant amount of the massive improvements in execution speed seen in computing over the past decade.&lt;br /&gt;
&lt;br /&gt;
In other words, not only may concurrent executions be interleaved, but they may also be reordered and otherwise manipulated in an optimized form that bears little resemblance to their source code. As compiler and run-time technology matures and multiprocessors become more prevalent, such phenomena become more common. They can lead to surprising results for programmers with backgrounds in sequential programming who have never been exposed to the underlying execution properties of allegedly sequential code. This can be the source of subtle concurrent programming errors. In almost all cases, there is an obvious, simple way to avoid contemplation of all the complexities arising in concurrent programs due to optimized execution mechanics: Use &lt;span style="color: red;"&gt;synchronization&lt;/span&gt;. There are multiple ways to achieve synchronization.&amp;nbsp; Below we'll disucusss using &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;volatile&lt;/span&gt; keyword in Java for limited cases. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Volatile&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
In terms of atomicity, visibility, and ordering, declaring a field as &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;volatile&lt;/span&gt; is nearly identical in effect to using a little fully synchronized class protecting only that field via get/set methods, as in:&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;pre&gt;final class VFloat { 
  private float value; 

  final synchronized void set(float f) { value = f; } 
  final synchronized float get() { return value; } 
}&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
This may invovle low-level memory barrier machine instructions to keep value representations in synch across threads.&amp;nbsp; However,&amp;nbsp;it&amp;nbsp;involves no locking.&amp;nbsp;&amp;nbsp; In the following sections, we will discuss what're the good occasions for you to use volatile and what're the dangers of misusing it.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;When to Use Volatile&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Declaring fields as &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;volatile&lt;/span&gt; can be useful when you do not need locking for any other reason, yet values must be accurately accessible across multiple threads. This may occur when&lt;sup&gt;[5]&lt;/sup&gt;: &lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;The field need not obey any invariants with respect to others. &lt;/li&gt;
&lt;li&gt;Writes to the field do not depend on its current value.&lt;/li&gt;
&lt;li&gt;No thread ever writes an illegal value with respect to intended semantics. &lt;/li&gt;
&lt;li&gt;The actions of readers do not depend on values of other non-volatile fields.&lt;/li&gt;
&lt;/ul&gt;
Below we provide some examples for such usages:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;b&gt;&lt;u&gt;Use volatile in DCL&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Double-checked locking&lt;/span&gt; (DCL) is OK as of Java 5 provided that you make the instance reference &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;volatile&lt;/span&gt;.&lt;/div&gt;
&lt;br /&gt;
&lt;pre&gt;// Works with acquire/release semantics for volatile in Java 5
class Foo {
  private volatile Helper helper = null;
  public Helper getHelper() {
  if (helper == null) {
    synchronized(this) {
      if (helper == null)
        helper = new Helper();
      }
    }
    return helper;
  }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
In Java 5, JLS&amp;nbsp;ensures that the unsycnrhonized volatile read must happen after the write has taken place, and the reading thread will see the correct values of all fields on &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Helper&lt;/span&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;b&gt;&lt;u&gt;Use volatile in Control Flag&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;pre&gt;// Cooperative thread termination with a volatile field
public class StopThread {
    private static volatile boolean stopRequested;

    public static void main(String[] args)
            throws InterruptedException {
        Thread backgroundThread = new Thread(new Runnable() {
            public void run() {
                int i = 0;
                while (!stopRequested)
                    i++;
            }
        });
        backgroundThread.start();

        TimeUnit.SECONDS.sleep(1);
        stopRequested = true;
    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
Volatile declarations on control flags&amp;nbsp;are needed to ensure that result flag values are visible across threads.&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Dangers of Using volatile Keyword&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Composite operations such as the "++" operation on volatile variables both read and write the variable.&amp;nbsp; So,&amp;nbsp;they are&amp;nbsp;not atomic.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;// Need to add synchronized modifier to the volatile variable
// Once you’ve done that, you can and should remove the volatile modifier&amp;nbsp;
// from nextSeuqenceNumber[8].
private static int nextSequenceNubmer = 0;
public static synchronized int nextSeuqenceNumber() {
  return nextSequenceNumber++;
}&lt;/pre&gt;
&lt;br /&gt;
Ordering and visibility effects surround only the single access or update to the volatile field itself. Declaring a reference field as volatile does not ensure visibility of non-volatile fields that are accessed via this reference. Similarly, declaring an array field as volatile does not ensure visibility of its elements.&amp;nbsp;&amp;nbsp; In other words, it is unsafe to call arr[x] = y on an array (even if declared volatile) in one thread and then expect arr[x] to return y from another thread.&amp;nbsp; See [1] for possible ways of fixing this issue.&lt;br /&gt;
&lt;br /&gt;
Because no locking is involved, declaring fields as volatile is likely to be cheaper than using synchronization, or at least no more expensive. However, if volatile fields are accessed frequently inside methods, their use is likely to lead to slower performance than would locking the entire methods.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;References&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/volatile_arrays.shtml" target="_blank"&gt;Volatile Arrays in Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/synchronization_volatile_dangers.shtml" target="_blank"&gt;Dangers of Volatile Keyword&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/synchronization_volatile_java_5.shtml" target="_blank"&gt;The Volatile Keyword in Java 5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/synchronization_volatile.shtml" target="_blank"&gt;The Volatile Keyword in Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/threads/thread_safety.shtml" target="_blank"&gt;Synchronization and Thread Safety in Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javamex.com/tutorials/double_checked_locking_fixing.shtml" target="_blank"&gt;Double-Checked Locking and How to Fix it&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://gee.cs.oswego.edu/dl/cpj/jmm.html" target="_blank"&gt;Synchronization and Java Memory Model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Effective Java&lt;/i&gt; by Joshua Bloch&lt;/li&gt;
&lt;li&gt;&lt;a href="http://java.sun.com/docs/books/jls/download/langspec-3.0.pdf" target="_blank"&gt;The Java Language Specification&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-5118373913214858807?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/4SS3WPA-ovw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/5118373913214858807/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=5118373913214858807" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/5118373913214858807?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/5118373913214858807?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/4SS3WPA-ovw/volatile-keyword-in-java.html" title="Volatile Keyword in Java" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-ppZiuGXl_EM/Txx_-S2sw4I/AAAAAAAAArM/sMObbh17voA/s72-c/Reordering.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/volatile-keyword-in-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MAQHkzfip7ImA9WhRUGUk.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-3669671838139159862</id><published>2012-01-21T16:43:00.000-08:00</published><updated>2012-01-30T09:44:01.786-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T09:44:01.786-08:00</app:edited><title>Singleton Is Not as Simple as You Think</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/N9wlqaGQLpFIJLZwFS2o8-lGc5I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N9wlqaGQLpFIJLZwFS2o8-lGc5I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/N9wlqaGQLpFIJLZwFS2o8-lGc5I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N9wlqaGQLpFIJLZwFS2o8-lGc5I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;As Gamma et al.&lt;sup&gt;&lt;span style="font-size: x-small;"&gt;[1]&lt;/span&gt;&lt;/sup&gt; put it, &lt;b&gt;singleton&lt;/b&gt; ensures a class only has one instance,and provides a global point of access to it. &lt;br /&gt;
&lt;br /&gt;
&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;Typically, when modelling a system, business objects come out of the &lt;b&gt;nouns&lt;/b&gt; defined within a use case statement&lt;sup&gt;&lt;span style="font-size: x-small;"&gt;[2]&lt;/span&gt;&lt;/sup&gt;. These Business Objects are acted upon by the external actors such as User of the System.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you have only one file system or one window manager in the modelled system, these business objects are good candidates for singletons.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Creating and Destroying Objects&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;As a Java developer, one design consideration is related to create and destroy objects.&amp;nbsp; Multiple design decisions need to be made on:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;When and how to create objects&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;When and how to avoid creating them&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;How to ensure that objects are destroyed in a timely manner&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;How to manage any cleanup actions that must precede object destruction.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;Using singleton, it can simplify the above design decisions.&amp;nbsp; With it, a class can ensure that no other instance can be created (by instercepting requrests to create new objects), and it provides a way to access the instance.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
However, as pointed out in this article, using singleton design pattern in a cluster environment is challenging.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Cluster&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A computer cluster consists of a set of loosely connected computers that work together.&amp;nbsp; If all nodes in the system use the same hardware, they are named &lt;b&gt;cluster&lt;/b&gt;.&amp;nbsp; If the nodes use different hardware, they are named &lt;b&gt;grid&lt;/b&gt;.&amp;nbsp; Technologies like cluster or grid have all aimed at allowing access to large amounts of computing power in a fully virtualized manner, by aggregating resources and offering a single system view.&amp;nbsp; For example, &lt;b&gt;Oracle RAC&lt;/b&gt; (Real Application Clusters) allows multiple computers to run Oracle RDBMS software simultaneously while accessing a single database, thus providing a clustered database.&lt;br /&gt;
&lt;br /&gt;
When Fusion web application runs in a clustered environment,&amp;nbsp;it must be possible for the node that the application is running on to fail, but to have it switched to a separate node without any impact on the user. The application server makes this possible by &lt;b&gt;serializing&lt;/b&gt; the state that the application requires. If a node goes down, the user is moved to a different node, and the state is automatically recovered. &lt;br /&gt;
&lt;br /&gt;
Similarly managed servers in a Oracle WebLogic domain may be grouped together in a cluster , running simultaneously and working together for increased scalability and reliability&lt;span class="quad_Z"&gt;&lt;span class="ContentBody"&gt;&lt;sup&gt;&lt;span style="font-size: x-small;"&gt;[9]&lt;/span&gt;&lt;/sup&gt;&lt;/span&gt;&lt;/span&gt;.&amp;nbsp; In such a cluster, most resources and services are deployed identically to each managed server, enabling &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;fail-over&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;load-balancing&lt;/span&gt;.&amp;nbsp; Either &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;active-active&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;active-passive&lt;/span&gt; failover patterns can be supported.&amp;nbsp; For an active-active configuration, it&amp;nbsp;requires an external load balancer to detect failure and automatically redirect requests.&amp;nbsp; For an active-passive configuration, it provides a fully redundant instance of each node, which is only brought online when its associated primary node fails.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Multiple Singleton Implementations&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Implementation 1&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
// Singleton with public final field&lt;br /&gt;
public class Singleton {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static final Singleton INSTANCE = new Singleton();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private Singleton() { ... }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doSomething() { ... }&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
As noted in [5], a privileged client can invoke the private constructor reflectively with the aid of the &lt;tt&gt;AccessibleObject.setAccessible&lt;/tt&gt;&lt;a href="http://www.blogger.com/" name="constructor to"&gt;&lt;/a&gt; method. If you need to defend against this attack, modify the constructor to make it throw an exception if it’s asked to create a second instance.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Implementation 2&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
// Singleton with static factory&lt;br /&gt;
public class Singleton {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final Singleton INSTANCE = new Singleton();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private Singleton() { ... }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Singleton getinstance() { return INSTANCE ; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doSomething() { ... }&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
One advantage of the factory-method approach is that it gives you the flexibility to change your mind about whether the class should be a singleton without changing its API. The factory method returns the sole instance but could easily be modified to return, say, a unique instance for each thread that invokes it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Implementation 3&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
// Enum singleton&lt;br /&gt;
public enum Singleton {&lt;br /&gt;
&amp;nbsp; INSTANCE;&lt;br /&gt;
&amp;nbsp; public void doSomething() { ... }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In [5], Joshua Bloch states that this approach is functionally equivalent to the public field approach (i.e., Implementation 1), except that it is more concise, provides the serialization machinery for free, and provides an ironclad guarantee against multiple instantiation, even in the face of sophisticated serialization or reflection attacks. In his opinion, a single-element enum type is the best way to implement a singleton.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Implementation 4&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
// Singleton implemented with lazy initialization&lt;br /&gt;
public class Singleton {&lt;br /&gt;
&amp;nbsp;private static Singleton INSTANCE = null;&lt;br /&gt;
&amp;nbsp;protected Singleton() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; // Exists only to defeat instantiation.&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;public synchronized static Singleton getInstance() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(INSTANCE == null) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSTANCE = new Singleton();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return INSTANCE;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&amp;nbsp; public void doSomething() { ... }&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
Because synchronization is very expensive performance-wise (synchronized methods can run up to 100 times slower than unsynchronized methods), we can introduce a performance enhancement that only synchronizes the singleton assignment in &lt;code&gt;getInstance()&lt;sup&gt;&lt;span style="font-family: Times New Roman; font-size: x-small;"&gt;[4]&lt;/span&gt;&lt;/sup&gt;&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Implementation 5&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
// initialization-on-demand holder&lt;br /&gt;
public class Singleton { &lt;br /&gt;
&amp;nbsp; private Singleton() { }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;private static class LazyHolder { &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static final Singleton INSTANCE = new Singleton(); &lt;br /&gt;
&amp;nbsp; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp; public static Singleton getInstance() { &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return LazyHolder.INSTANCE; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp; public void doSomething() { ... }&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
The static class &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;LazyHolder&lt;/span&gt; is only executed when the static method &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;getInstance&lt;/span&gt; is invoked on the class &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Singleton&lt;/span&gt;, and the first time this happens the JVM will load and initialize the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;LazyHolder&lt;/span&gt; class. The initialization of the LazyHolder class results in static variable INSTANCE being initialized by executing the (private) constructor for the outer class Singleton. &lt;br /&gt;
&lt;br /&gt;
Since the class initialization phase is guaranteed by the JLS to be serial, i.e., non-concurrent, no further synchronization is required in the static getInstance method during loading and initialization. And since the initialization phase writes the static variable INSTANCE in a serial operation, all subsequent concurrent invocations of the getInstance will return the same correctly initialized INSTANCE without incurring any additional synchronization overhead.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;When is a Singleton not a Singleton?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
In [3], &lt;b&gt;Joshua Fox&lt;/b&gt; has shown that you can inadvertently allow more than one instance to be created under the following circumstances:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Multiple singletons in two or more virtual machines&lt;/li&gt;
&lt;li&gt;Multiple singletons simultaneously loaded by different class loaders&lt;/li&gt;
&lt;li&gt;Singleton classes destroyed by garbage collection, then reloaded&lt;/li&gt;
&lt;li&gt;Purposely reloaded singleton classes&lt;/li&gt;
&lt;li&gt;Multiple instances resulting from incorrect synchronization&lt;/li&gt;
&lt;li&gt;Multiple singletons arising when someone has subclassed your singletons &lt;/li&gt;
&lt;li&gt;Multiple singletons created by a factory specially asked to create multiple objects&lt;/li&gt;
&lt;li&gt;Copies of a singleton object that has undergone serialization and deserialization&lt;/li&gt;
&lt;li&gt;Multiple singletons caused by problems in a factory&lt;/li&gt;
&lt;/ul&gt;
As shown above, implementing singletons in Java is anything but simple. In [4], &lt;b&gt;David Geary&lt;/b&gt; tells you how to test singleton classes by using JUnit and log4j.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Singleton in Cluster Environment&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To support singletons in a cluster, you need to ask yourselves one question:&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Is it&amp;nbsp;"single" in the context of the running VM good enough&lt;/li&gt;
&lt;/ul&gt;
If your application requires an absolutely single instance in a cluster, you need to read [3] to see how to avoid the pitfalls of creating multiple singletons.&lt;br /&gt;
&lt;br /&gt;
In a cluster environment, application state needs to be &lt;b&gt;serialized&lt;/b&gt; and preserved across multiple nodes.&amp;nbsp; &lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;To make a singleton class serializable, it is not sufficient merely to add implements &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Serializable&lt;/span&gt; to its declaration.&amp;nbsp; To maintain the singleton guarantee, you must also provide a &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;readResolve&lt;/span&gt; method.&amp;nbsp; Otherwise, each deserialization of a serialized instance will result in the creation of a new instance.&amp;nbsp; To prevent this, add the following &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;readResolve&lt;/span&gt; method to the Singleton class:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
// &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;readResolve&lt;/span&gt; method to preserve singleton property&lt;br /&gt;
private Object readResolve() throws ObjectStreamExcetion {&lt;br /&gt;
&amp;nbsp; // Return the one true INSTANCE and let the garbage collector take care of the cloned one&lt;br /&gt;
&amp;nbsp; return INSTANCE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
In [7], it has discussed a case that uses singleton to cache some custom information from Database.&amp;nbsp; This information is mostly read-only but gets refreshed when some particular event occurs.&amp;nbsp; A question is asked:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;When this singleton is deployed in a clustered environment, what is the best way to keep the cache in sync.&lt;/li&gt;
&lt;/ul&gt;
I'll just refer you to read [7] for possible approaches.&amp;nbsp; However, in general, the approach is based on the object being cached.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;If the object being cached is read-only or thread-safe, you simply make the field volatile.&lt;/li&gt;
&lt;li&gt;If the cache object is mutable and not thread-safe, you have to make sure that any access to mutable fields in the object are synchronized.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;References&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;i&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/i&gt; by Gamma et al.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://javaboutique.internet.com/tutorials/businessObject/" target="_blank"&gt;The Mysteries of Business Object&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/Programming/singletons/" target="_blank"&gt;When is a Singleton not a Singleton?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns.html?page=2" target="_blank"&gt;Simply Singleton&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Effective Java &lt;/i&gt;by Joshua Bloch&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/High-availability_cluster" target="_blank"&gt;High-availability cluster&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/1194129/singleton-in-cluster-environment" target="_blank"&gt;Singleton in Cluster environment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Initialization_on_demand_holder_idiom" target="_blank"&gt;Initialization-on-demand holder idiom&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://java.net/downloads/oraclesoasuite11g/OSB/video/clustering/OSB_Clustering.html" target="_blank"&gt;Oracle Service Bus Clustering for Developers &lt;/a&gt;by Jeff Davies&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-3669671838139159862?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/Rq-R1Jakjck" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/3669671838139159862/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=3669671838139159862" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/3669671838139159862?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/3669671838139159862?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/Rq-R1Jakjck/singleton-is-not-as-simple-as-you-think.html" title="Singleton Is Not as Simple as You Think" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/singleton-is-not-as-simple-as-you-think.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cAQHg_eSp7ImA9WhRbEEg.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-808941142410831391</id><published>2012-01-15T21:05:00.000-08:00</published><updated>2012-01-31T17:17:21.641-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-31T17:17:21.641-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java.lang.OutOfMemoryError" /><category scheme="http://www.blogger.com/atom/ns#" term="Java Heap Space" /><category scheme="http://www.blogger.com/atom/ns#" term="Hotspot VM" /><category scheme="http://www.blogger.com/atom/ns#" term="Garbage Collection" /><category scheme="http://www.blogger.com/atom/ns#" term="Garbage Collector" /><category scheme="http://www.blogger.com/atom/ns#" term="Generation Space" /><title>Understanding Garbage Collection</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CIGAqSiQeebgbn4-XkkvtxugW3c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CIGAqSiQeebgbn4-XkkvtxugW3c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CIGAqSiQeebgbn4-XkkvtxugW3c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CIGAqSiQeebgbn4-XkkvtxugW3c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Every Java programmer will encounter&lt;/span&gt; &lt;/div&gt;
&lt;ul style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;li&gt;&lt;strong&gt;java.lang.OutOfMemoryError: Java heap space&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;sooner or later.&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;/span&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;The most often offered advices include:&lt;/span&gt; &lt;/div&gt;
&lt;ul style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Try increase the MaxPermSize first&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Increase the PermSize to 256m&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;In this article, we will show what &lt;em&gt;heap space&lt;/em&gt;, &lt;em&gt;PermSize&lt;/em&gt; or &lt;em&gt;MaxPermSize&lt;/em&gt; is.&amp;nbsp; Using &lt;/span&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Hotspot &lt;/span&gt;as our JVM, we will introduce you to the following topics:&lt;/span&gt;&lt;/div&gt;
&lt;ul style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Garbage Collector (GC)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Which JVM?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;JVM Command Options&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Garbage Collector&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;GC provided by &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Hotspot VM&lt;/span&gt; is a generational GC which is based on two observations:&lt;/span&gt;&lt;/div&gt;
&lt;ol style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;The most recently created objects are also those most likely to become unreachable quickly&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="border-collapse: separate; color: black; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;There are few references from older to younger objects&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;The advantage of a generational GC is that each generation can be managed by the garbage collection algorithm most appropriate for its characteristics. &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Hotspot VM&lt;/span&gt; divides its heap space into three generational spaces:&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;&lt;strong&gt;Young Generation&lt;/strong&gt;&lt;/span&gt; &lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;When a Java application allocates Java objects, those objects are allocated in the young generation space &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Is typically small and collected frequently&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia;"&gt;&lt;strong&gt;Old&amp;nbsp;Generationn&lt;/strong&gt;&lt;/span&gt; &lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Objects that are longer-lived are eventually promoted, or tenured, to the old generation &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Is typically larger than the young generation, and its occupancy grows more slowly&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia;"&gt;&lt;strong&gt;Permanent Generation&lt;/strong&gt;&lt;/span&gt; &lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Holds VM and Java class metadata as well as interned Strings and class static variables&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;strong&gt;&lt;u&gt;Minor vs Full GC&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
A garbage collection occurs when any one of those three generational spaces is considered full and there is some request for additional space that is not available.&amp;nbsp; There are two types of garbage collection activities: &lt;em&gt;minor&lt;/em&gt; and &lt;em&gt;full&lt;/em&gt;.&amp;nbsp;&amp;nbsp; &lt;span style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-collapse: separate; color: black; font: small Tahoma; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="font-size: 19px;"&gt;&lt;/span&gt;&lt;/span&gt;When the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;young generation&lt;/span&gt; fills up, it triggers a minor collection in which the surviving objects are moved to the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;old generation&lt;/span&gt;. When the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;old generation&lt;/span&gt; fills up, it triggers a full collection which involves the entire object heap.&lt;/div&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;span style="font-size: small;"&gt;&lt;strong&gt;Minor GC&lt;/strong&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;
&lt;ul&gt;
&lt;li&gt;Occurs when the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;young generation space&lt;/span&gt; does not have enough room&lt;/li&gt;
&lt;li&gt;Tends to be short in duration relative to full garbage collections&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;strong&gt;Full GC&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Occurs when the VM determines there is not enough available space for object promotions from the next minor garbage collection &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Takes a longer time depending upon the heap size.&amp;nbsp; However, if it takes longer than 3 to 5 seconds, then it's too long&lt;sup&gt;[1]&lt;/sup&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Full garbage collections typically have the longest duration and as a result are the number one reason for applications not meeting their latency or throughput requirements.&amp;nbsp;&amp;nbsp; The goal of GC tuning is to reduce the number and frequency of full garbage collections experienced by the application.&amp;nbsp; To achieve it, we can approach from two sides:&lt;/span&gt; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;From the system side&lt;/span&gt; &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia;"&gt;You should use as large a heap size as possible without causing your system to "swap" pages to disk.&amp;nbsp; Typically, you should use 80 percent of the available RAM (not taken by the operating system or other processes) for your JVM&lt;sup&gt;[1]&lt;/sup&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia;"&gt;The larger the Java heap space, the better the garbage collector and application perform when it comes to &lt;em&gt;throughput&lt;/em&gt; and &lt;em&gt;latency&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia;"&gt;From the application side&lt;/span&gt; &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;A reduction in &lt;em&gt;object allocations&lt;/em&gt;, more importantly, &lt;em&gt;object retention&lt;/em&gt; helps reduce the live data size, which in turn helps the GC and application to perform.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;strong&gt;&lt;u&gt;OutOfMemoryError&lt;/u&gt;&lt;/strong&gt; &lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;The dreaded &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;OutOfMemoryError&lt;/span&gt; is something that no Java programmer ever wishes to see. Yet it can happen, particularly if your application involves a large amount of data processing, or is long lived.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;The total memory size of an application includes:&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Java heap size &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Thread stacks&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;I/O buffers&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Memory allocated by native libraries &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;If an application runs out of memory and JVM GC fails to reclaim more object spaces, an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;OutOfMemoryError&lt;/span&gt; exception will be thrown.&amp;nbsp; The only way to fix it is to adjust heap size.&amp;nbsp; We will discuss how to fix it in the following sections.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Georgia; font-size: large;"&gt;&lt;strong&gt;Which JVM?&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Georgia;"&gt;&lt;br /&gt;You can use &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;jps&lt;/span&gt; (Java Virtual Machine Process Status Tool) to list&amp;nbsp;all &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;local VM identifiers&amp;nbsp;&lt;/span&gt;of instrumented HotSpot Java Virtual Machines (JVMs) on the target Linux system.&amp;nbsp; For example, on my system, it lists:&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;$ jps 
17291 Server
17468 Jps
7883 Launcher&lt;/pre&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-size: small;"&gt;This list includes one Integrated WebLogic Server (i.e., &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Server&lt;/span&gt;) and one JDeveloper (i.e., &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;Launcher&lt;/span&gt;).&amp;nbsp; The reason for us to know which JVM throws the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;OutOfMemoryError&lt;/span&gt; is because each application uses its own configuration file to start&amp;nbsp;its JVM&amp;nbsp;and you need to know where to find it.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
For example, to change heap space sizes, you can modify those parameters in: &lt;/div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;JDeveloper &lt;ul&gt;
&lt;li&gt;$JDEV_HOME/jdev/bin/jdev.conf&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;WebLogic Server &lt;ul&gt;
&lt;li&gt;&amp;lt;Domain Location&amp;gt;/bin/setDomainEnv.sh&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Eclipse &lt;ul&gt;
&lt;li&gt;&amp;lt;Eclipse Installation Location&amp;gt;/eclipse.ini&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;strong&gt;&lt;span style="font-size: large;"&gt;JVM Command Options&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;GC tuning is non-trivial.&amp;nbsp; Finding the optimal generation space sizes involves an iterative process&lt;sup&gt;[3]&lt;/sup&gt;.&amp;nbsp; Here we assume you have successfully identified the optimal heap space sizes for your application.&amp;nbsp; Then you can use the following JVM command options to set them:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-khHTiPM7DrI/TxOlDM4e9fI/AAAAAAAAArE/psVneGusYKQ/s1600/generationSpaces.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="226" kba="true" src="http://1.bp.blogspot.com/-khHTiPM7DrI/TxOlDM4e9fI/AAAAAAAAArE/psVneGusYKQ/s320/generationSpaces.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
﻿&lt;/div&gt;
&lt;br /&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" style="font-family: Georgia; text-align: left; width: 100%;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="background-color: #ffcc33; font-weight: bold; vertical-align: top;"&gt;GC Command Line Options&lt;/td&gt;&lt;td style="background-color: #ffcc33; font-weight: bold; vertical-align: top;"&gt;Description&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;-Xms&lt;/span&gt; &lt;/td&gt;&lt;td style="vertical-align: top;"&gt;Sets the&amp;nbsp; &lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;initial and minimum size of java heap size&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;-Xmx&lt;/span&gt; &lt;/td&gt;&lt;td style="vertical-align: top;"&gt;Sets the &lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;maximum size of java heap size&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;-Xmn&lt;/span&gt; &lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;Sets the initial, minimum, and maximum size of the&amp;nbsp;&lt;span style="font-family: Courier New;"&gt;young generation space&lt;/span&gt;. &amp;nbsp; Note that&amp;nbsp;&lt;/span&gt; &lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;the size of the&amp;nbsp;&lt;span style="font-family: Courier New;"&gt;old generation space&lt;/span&gt;&amp;nbsp;is&amp;nbsp;&lt;b&gt;implicitly set&lt;/b&gt;&amp;nbsp;based on the size of the &lt;span style="font-family: Courier New;"&gt;young generation space&lt;/span&gt;.&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;-XX:PermSize=&amp;lt;n&amp;gt;[g|m|k]&lt;/span&gt; &lt;/td&gt;&lt;td style="vertical-align: top;"&gt;Sets the &lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;initial and minimum size of permanent generation space&lt;/span&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;-XX:MaxPermSize=&amp;lt;n&amp;gt;[g|m|k]&lt;/span&gt; &lt;/td&gt;&lt;td style="vertical-align: top;"&gt;Sets the maximum &lt;span style="border-collapse: separate; color: black; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;size of permanent generation space&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://docs.oracle.com/cd/E13222_01/wls/docs81/perform/JVMTuning.html" target="_blank"&gt;Tuning Java Virtual Machines (JVMs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/05/diagnosing-javalangoutofmemory.html" target="_blank"&gt;Diagnosing Java.lang.OutOfMemoryError&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Java Performance &lt;/em&gt;by Charlie Hunt and Binu John&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html" target="_blank"&gt;Java HotSpot VM Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.tagtraum.com/gcviewer.html" target="_blank"&gt;GCViewer&lt;/a&gt; (a free open source tool)&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-808941142410831391?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/wafNQ28XOOc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/808941142410831391/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=808941142410831391" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/808941142410831391?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/808941142410831391?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/wafNQ28XOOc/understanding-garbage-collection.html" title="Understanding Garbage Collection" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-khHTiPM7DrI/TxOlDM4e9fI/AAAAAAAAArE/psVneGusYKQ/s72-c/generationSpaces.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/understanding-garbage-collection.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUFQn0ycSp7ImA9WhRVEkw.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-4454939969789660183</id><published>2012-01-07T14:44:00.000-08:00</published><updated>2012-01-10T09:23:33.399-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-10T09:23:33.399-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hashCode()" /><category scheme="http://www.blogger.com/atom/ns#" term="equals()" /><category scheme="http://www.blogger.com/atom/ns#" term="Java Object" /><title>hashCode() and equals() in Java</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CVlpyeE-efbNVopWT8KVHgPWfmE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CVlpyeE-efbNVopWT8KVHgPWfmE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CVlpyeE-efbNVopWT8KVHgPWfmE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CVlpyeE-efbNVopWT8KVHgPWfmE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Java object's hash code is important to the performance of &lt;a href="http://en.wikipedia.org/wiki/Hash_table" title="Hash table"&gt;&lt;/a&gt;hash tables and other data structures&lt;a href="http://en.wikipedia.org/wiki/Data_structure" title="Data structure"&gt;&lt;/a&gt; that store objects in groups ("buckets") based on their computed hash values.  Good implementation of &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() must:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Follow its general contract&lt;sup&gt;[1]&lt;/sup&gt;&lt;/li&gt;&lt;li&gt;Generate values that are evenly distributed for varied inputs to avoid clustering&lt;/li&gt;&lt;/ul&gt;Overriding &lt;span style="font-family:courier new;"&gt;equals&lt;/span&gt;() and &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() in your class needs to be considered together.  In this article, we'll examine why.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Object Identity vs. Logical Identity&lt;/h3&gt; &lt;ul&gt;&lt;li style="font-weight: bold;"&gt;Object identity&lt;/li&gt;&lt;ul&gt;&lt;li&gt;For two object references &lt;span style="font-family:courier new;"&gt;x &lt;/span&gt;and &lt;span style="font-family:courier new;"&gt;y&lt;/span&gt;, two objects are equal if and only if  &lt;span style="font-family:courier new;"&gt;x &lt;/span&gt;and &lt;span style="font-family:courier new;"&gt;y &lt;/span&gt;refer to  the same object. This is the default behavior of &lt;span style="font-family:courier new;"&gt;java.lang.Object.equals&lt;/span&gt;(). &lt;/li&gt;&lt;/ul&gt;&lt;li style="font-weight: bold;"&gt;Logical identity&lt;/li&gt;&lt;ul&gt;&lt;li&gt;For two value object references &lt;span style="font-family:courier new;"&gt;x &lt;/span&gt;and &lt;span style="font-family:courier new;"&gt;y&lt;/span&gt;, two value objects are equal if their  values are identical even they may refer to different objects.  &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;h3&gt;When to Override equals()&lt;/h3&gt;&lt;br /&gt;Your class needs to override the default  &lt;span style="font-family:courier new;"&gt;object identity &lt;/span&gt;behavior if &lt;span style="font-family:courier new;"&gt;logical identity &lt;/span&gt;is its desired behavior and a  superclass has not already overridden &lt;span style="font-family:courier new;"&gt;Object's&lt;/span&gt; default &lt;span style="font-family:courier new;"&gt;equals&lt;/span&gt;() implementation.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Override hashCode() If equals() Is Overridden&lt;/h3&gt;&lt;span style="font-family:georgia;"&gt;&lt;br /&gt;An  object's &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() method digests the data  stored in the object into a single hash value (a 32-bit signed  integer). Hash value cannot be used as a &lt;/span&gt;&lt;span style="font-family:georgia;"&gt;unique  identifier for an object&lt;/span&gt; because &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() is not required to produce  distinct integer results for unequal objects based on its contract. However, a  good hash function &lt;span style="font-family:georgia;"&gt;tends to produce unequal hash values for  unequal objects.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Always override &lt;span style="font-family:courier new;"&gt;hashCode() &lt;/span&gt;when  you override &lt;span style="font-family:courier new;"&gt;equals()&lt;/span&gt;. Failure to do so &lt;/span&gt;&lt;span style="font-family:georgia;"&gt;will prevent  your class from functioning properly in conjunction with all hash-based  collections, including &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;&lt;span style="font-family:georgia;"&gt;HashMap&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;&lt;span style="font-family:georgia;"&gt;HashSet&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;&lt;span style="font-family:georgia;"&gt;Hashtable&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:georgia;"&gt;The reason  is that one of the &lt;/span&gt;&lt;span style="font-family:georgia;"&gt;general contract of &lt;span style="font-family:courier new;"&gt;hashCode &lt;/span&gt;dictates that: &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;If two objects are equal according to the &lt;span style="font-family:courier new;"&gt;equals(Object)&lt;/span&gt;  method, then calling the &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt; method on each  of the two objects must produce the same integer  result.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:georgia;"&gt;If you override &lt;span style="font-family:courier new;"&gt;equals&lt;/span&gt;() by changing its behavior from &lt;span style="font-family:courier new;"&gt;object identity &lt;/span&gt;to &lt;span style="font-family:courier new;"&gt;logical  identity, &lt;span style="font-family:georgia;"&gt;then &lt;/span&gt;&lt;/span&gt;your &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() must produce the same hash value f&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;or two logically identical objects&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;.  However,  the default &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() &lt;/span&gt;is typically  implemented by converting the internal address of the object into an integer. Therefore, the default &lt;span style="font-family:georgia;"&gt;&lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() will return different hash values for two logically identical objects, which violates the general contract.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Queries on hash-based  collections&lt;/span&gt; &lt;span style="font-family:georgia;"&gt;should run in linear time. If a bad hash  function is used, it might run in &lt;/span&gt;&lt;span style="font-family:georgia;"&gt;quadratic  time.&lt;/span&gt; For example, if a &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() always returns a fixed hash value, &lt;span style="font-family:georgia;"&gt;hash tables essentially degenerate to linked lists.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;As with any general hashing function, collisions are  possible. If that happens, objects will be put in groups (or buckets) based on  their computed hash values.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Summary&lt;br /&gt;&lt;/h3&gt; &lt;ul&gt;&lt;li&gt;If a class overrides &lt;span style="font-family:courier new;"&gt;equals&lt;/span&gt;(), it must override &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;()&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;equals&lt;/span&gt;() and &lt;span style="font-family:courier new;"&gt;hashCode&lt;/span&gt;() must use the same set of significant fields of your  object&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You can exclude &lt;span style="font-family:courier new;"&gt;redundant fields &lt;/span&gt;which can be computed from other significant fields that are  included in the computation&lt;/li&gt;&lt;li&gt;If you exclude &lt;span style="font-family:courier new;"&gt;redundant fields&lt;/span&gt;, treat them the same way in both  methods&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;If two objects are equal, then their &lt;span style="font-family:courier new;"&gt;hashCode &lt;/span&gt;values must be equal as well&lt;br /&gt;&lt;ul&gt;&lt;li&gt;However, unequal objects need not produce distinct hash values&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;If the object is immutable, then hashCode is a candidate for caching and  lazy initialization&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Read More&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html"&gt;java.lang.Object&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.technofundo.com/tech/java/equalhash.html"&gt;Equals and Hash Code in Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Effective Java &lt;/span&gt;by Joshua Bloch&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-4454939969789660183?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/BG2keiZ-HSY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/4454939969789660183/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=4454939969789660183" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/4454939969789660183?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/4454939969789660183?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/BG2keiZ-HSY/javas-hashcode-and-equals.html" title="hashCode() and equals() in Java" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/javas-hashcode-and-equals.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYMRn04cSp7ImA9WhRWGUo.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-9194800907885186702</id><published>2012-01-07T11:12:00.001-08:00</published><updated>2012-01-07T14:43:07.339-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-07T14:43:07.339-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Interview Question" /><category scheme="http://www.blogger.com/atom/ns#" term="Job Interview" /><title>IT Job Interview Questions</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L5c2IlUU3khGYZDA-QExESf6Dz0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L5c2IlUU3khGYZDA-QExESf6Dz0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L5c2IlUU3khGYZDA-QExESf6Dz0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L5c2IlUU3khGYZDA-QExESf6Dz0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;h3&gt;Questions&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;What's the next number in this sequence: 10, 9, 60, 90, 70, 66 … ?&lt;/li&gt;&lt;li&gt;Using only a four-minute hourglass and a seven-minute hourglass,  measure exactly nine minutes—without the process taking longer than  nine minutes.&lt;/li&gt;&lt;li&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+---+&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| 1 |&lt;br /&gt;+---+---+---+&lt;br /&gt;| 2 | 3 | 4 |&lt;br /&gt;+---+---+---+&lt;br /&gt;| 5 | 6 | 7 |&lt;br /&gt;+---+---+---+&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| 8 |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+---+&lt;br /&gt;&lt;/pre&gt;Rearrange the above numbers in the squares such that any adjacent numbers (for example, 1 and 2 or 6 and 7) are not next to each other horizontally, vertically, or diagonally.  For example, in the above figure, 1 and 2 are next to each other diagonally, which violates the rule.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="entry"&gt;Three people work together to figure out their average salary without telling anybody his/her own salary.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;a href="http://4.bp.blogspot.com/-lTbwSFPpmEQ/TwibWOGBlFI/AAAAAAAAAq8/SrmJPzXQm7o/s1600/Norway.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 189px;" src="http://4.bp.blogspot.com/-lTbwSFPpmEQ/TwibWOGBlFI/AAAAAAAAAq8/SrmJPzXQm7o/s400/Norway.jpg" alt="" id="BLOGGER_PHOTO_ID_5694972534852785234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Answers&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;&lt;/strong&gt;Spell the numbers out: (Ten, Nine, Sixty, Ninety, Seventy, Sixty-six).  A correct response will have nine letters: 96.&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned here: &lt;/span&gt;If you tried to solve the series by looking for patterns and failed, look at the question from different angles.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Start both hourglasses at 0 minutes. Flip over the four-minute glass  when it runs out (at 4:00); ditto for the seven-minute glass (at 7:00).  When the four-minute glass runs out the second time (at 8:00), the  seven-minute glass will then have one minute of sand in its lower bulb.  Flip the seven-minute glass over again and let the minute of sand run  back. When the last grain falls, that will be nine minutes.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned here: &lt;/span&gt;4 + 3 + 1 + 1.  The important event is when the glass runs out the sand.  So, the decision to make involves when to flip the glass and which glass.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+---+&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| 7 |&lt;br /&gt;+---+---+---+&lt;br /&gt;| 3 | 1 | 4 |&lt;br /&gt;+---+---+---+&lt;br /&gt;| 5 | 8 | 6 |&lt;br /&gt;+---+---+---+&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| 2 |&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+---+&lt;br /&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned here&lt;/span&gt;: Place 1 and 8 at the center, which they are the most distant away.  Then place 2 and 7 at the opposite sides.  Finally, arrange 3-6 to be separate from each other.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Do it this way:&lt;ol&gt;&lt;li&gt;Each person chooses a random number and adds that number to his/her salary&lt;/li&gt;&lt;li&gt;At the first run, pass that number to next person and add them up.&lt;/li&gt;&lt;li&gt;Now, we have the sum of three person's salary plus 3 random numbers.&lt;/li&gt;&lt;li&gt;At the second run, remove his/her random number from the total and pass the new total to the next person.&lt;/li&gt;&lt;li&gt;Now, we have the sum of 3 person's salary.  Just divide it by 3.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Lesson learned here&lt;/span&gt;: Adding a random number to the salary helps encrypt his/her salary.  Then work together as described in two runs.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;References&lt;br /&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://online.wsj.com/article/SB10001424052970204552304577113003705089744.html"&gt;Answers to Google Interview Questions &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-9194800907885186702?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/n39qSmmmLag" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/9194800907885186702/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=9194800907885186702" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/9194800907885186702?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/9194800907885186702?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/n39qSmmmLag/it-job-interview-questions.html" title="IT Job Interview Questions" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-lTbwSFPpmEQ/TwibWOGBlFI/AAAAAAAAAq8/SrmJPzXQm7o/s72-c/Norway.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/it-job-interview-questions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QFRHo4eSp7ImA9WhRWF00.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-6979171000536585290</id><published>2012-01-03T21:43:00.000-08:00</published><updated>2012-01-04T11:28:35.431-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-04T11:28:35.431-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Memory Profiler" /><category scheme="http://www.blogger.com/atom/ns#" term="CPU Profiler" /><category scheme="http://www.blogger.com/atom/ns#" term="JDeveloper 11g" /><title>Starting the CPU Profiler in JDeveloper</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ENWKN7JrPrkNtkBBPYZN1KiYtjw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ENWKN7JrPrkNtkBBPYZN1KiYtjw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ENWKN7JrPrkNtkBBPYZN1KiYtjw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ENWKN7JrPrkNtkBBPYZN1KiYtjw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;JDeveloper offers two kinds of profilers: The &lt;span style="font-weight: bold;"&gt;CPU Profiler &lt;/span&gt;and the &lt;span style="font-weight: bold;"&gt;Memory Profiler&lt;/span&gt;, for local as well as remote profiling. &lt;ul&gt;&lt;li&gt;CPU Profiling enables you to identify the most expensive methods and threads in your program.&lt;/li&gt;&lt;li&gt;Memory profiling helps you to find out how your program is using the Java heap.&lt;/li&gt;&lt;/ul&gt;In this article, we will show you how to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Set Options for the CPU Profiler&lt;/li&gt;&lt;li&gt;Start the CPU Profiler&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;CPU Profiler&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The CPU Profiler tabulates and displays statistical data on the performance of your application.  It enables you to profile your code in one of two modes:&lt;br /&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;Sample CPU Time&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Method Call Count&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In Figure 1, it shows the result of method call count operation.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-hh_Y5OAf6UU/TwPrn2kVqRI/AAAAAAAAApo/tCealH9gHEQ/s1600/CPU_Profiler.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/-hh_Y5OAf6UU/TwPrn2kVqRI/AAAAAAAAApo/tCealH9gHEQ/s400/CPU_Profiler.jpg" alt="" id="BLOGGER_PHOTO_ID_5693653423821793554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Figure 1. &lt;/span&gt;Hotspots view of the method call count operation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-iP5vEV_tnhU/TwPvXumhZfI/AAAAAAAAAp0/wzpv9w6TRXk/s1600/CallStacks.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 219px;" src="http://1.bp.blogspot.com/-iP5vEV_tnhU/TwPvXumhZfI/AAAAAAAAAp0/wzpv9w6TRXk/s400/CallStacks.jpg" alt="" id="BLOGGER_PHOTO_ID_5693657544852071922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:georgia;"&gt;Figure 2. &lt;/span&gt;&lt;span style="font-family:georgia;"&gt;Call Stacks &lt;/span&gt;&lt;/span&gt;view of the method call count operation&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;The CPU Profiler displays data in two views:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Hotspots&lt;/span&gt; &lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Call Stacks&lt;/li&gt;&lt;/ul&gt;Also, depending on the mode of operation, they display different information.&lt;br /&gt;&lt;br /&gt;In the &lt;span style="font-family:courier new;"&gt;method call count operation&lt;/span&gt;, these views show:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Hotspots&lt;/span&gt; &lt;ul&gt;&lt;li&gt;all the methods and the number of times they were called (see Figure 1)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Call Stacks&lt;/span&gt;&lt;ul&gt;&lt;li&gt; the Java platform methods called, sorted by thread group (see Figure 2)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;In the &lt;span style="font-family:courier new;"&gt;time sampling mode of operation&lt;/span&gt;, these views show:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Hotspots&lt;/span&gt; &lt;ul&gt;&lt;li&gt;all Java platform methods and all methods they call, sorted by time usage&lt;/li&gt;&lt;li&gt;the cumulative amount of CPU time spent in each method  &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Call Stacks&lt;/span&gt;&lt;ul&gt;&lt;li&gt; the Java platform methods called in their call hierarchy&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Setting Options for the CPU Profiler&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can specify if you want the Profiler to sample CPU time usage by your application, or to count method calls.  Note that you can choose one mode at a time, not both.&lt;br /&gt;&lt;br /&gt;To set CPU Profiler options:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In the navigator, double-click the project you want to profile to open the Project Properties dialog. &lt;/li&gt;&lt;li&gt;Click &lt;span style="font-family:courier new;"&gt;Run/Debug/Profiler &lt;/span&gt;to open the &lt;span style="font-family:courier new;"&gt;Project Properties - Run/Debug/Profile&lt;/span&gt; page. &lt;/li&gt;&lt;li&gt;Click &lt;span style="font-family:courier new;"&gt;Edit&lt;/span&gt;. &lt;/li&gt;&lt;li&gt;In the &lt;span style="font-family:courier new;"&gt;Edit Run Configuration &lt;/span&gt;dialog, set the options as desired on the &lt;span style="font-family:courier new;"&gt;Tool Settings - Profiler - CPU&lt;/span&gt; page. You can specify if you want the profiler to sample CPU time or count method calls.  In Figure 3, we want the profiler to count method calls.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;When finished, click &lt;span style="font-family:courier new;"&gt;OK &lt;/span&gt;to close the &lt;span style="font-family:courier new;"&gt;Edit Run Configuration &lt;/span&gt;dialog.&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Xms-16wXXro/TwPxRx7SCZI/AAAAAAAAAqA/2Gc28aTJxVY/s1600/CountMethodCalls.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 286px;" src="http://3.bp.blogspot.com/-Xms-16wXXro/TwPxRx7SCZI/AAAAAAAAAqA/2Gc28aTJxVY/s400/CountMethodCalls.jpg" alt="" id="BLOGGER_PHOTO_ID_5693659641688492434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Figure 3.&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;  &lt;/span&gt;Edit Run Configuration Dialog&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;Starting the CPU Profile&lt;/span&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;r&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Starting a CPU profiling session will automatically run your program. Once the CPU profiler window is open (see Figure 1), you can begin a use case to profile your application.&lt;br /&gt;&lt;br /&gt;To start the CPU Profiler:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the navigator, select the project you want to profile. For example, &lt;span style="font-family: courier new;"&gt;OsmPublicUi&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;From the main menu, choose &lt;span style="font-family:courier new;"&gt;Run &amp;gt; &lt;span style="font-family: courier new;"&gt;CPU Profile OsmPublicUi.jpr&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;p&gt;The CPU Profiler opens and runs your application.&lt;br /&gt;&lt;/p&gt;&lt;li&gt;Click the&lt;a href="http://1.bp.blogspot.com/-ZhRoAAKQAHQ/TwPzdCtLOzI/AAAAAAAAAqM/riM805wK674/s1600/BeginUseCase.jpg"&gt;&lt;img style="margin: 0px auto 10px; text-align: center; cursor: pointer; width: 21px; height: 24px;" src="http://1.bp.blogspot.com/-ZhRoAAKQAHQ/TwPzdCtLOzI/AAAAAAAAAqM/riM805wK674/s400/BeginUseCase.jpg" alt="" id="BLOGGER_PHOTO_ID_5693662034194545458" border="0" /&gt;&lt;/a&gt; &lt;span style="font-family:courier new;"&gt; Begin Use Case &lt;/span&gt;icon to begin a profiling&lt;/li&gt;&lt;/ol&gt;&lt;a href="http://1.bp.blogspot.com/-_xhj2oFR5rE/TwSmK90Tv6I/AAAAAAAAAqY/kLV_loFHcwQ/s1600/RunCpuProfile.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 212px;" src="http://1.bp.blogspot.com/-_xhj2oFR5rE/TwSmK90Tv6I/AAAAAAAAAqY/kLV_loFHcwQ/s400/RunCpuProfile.jpg" alt="" id="BLOGGER_PHOTO_ID_5693858536226013090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:courier new;"&gt;Figure 4. Starting the CPU Profiler&lt;/span&gt;&lt;span style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;More &lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Hints&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If no default run target is specified in the Launch Settings page of the &lt;span style="font-family:courier new;"&gt; Edit Run Configuration&lt;/span&gt; dialog (&lt;span style="font-family:courier new;"&gt;Application menu &lt;/span&gt;&amp;gt; &lt;span style="font-family:courier new;"&gt;Project  Properties &lt;/span&gt;&amp;gt; &lt;span style="font-family:courier new;"&gt;Run/Debug/Profile&lt;/span&gt;), the &lt;span style="font-family:courier new;"&gt;Choose Default Run Target &lt;/span&gt;dialog  opens. Use this dialog to specify the default run target.&lt;br /&gt;&lt;br /&gt;If you want to profile your application immediately when the profiler is launched, select the &lt;span style="font-family:courier new;"&gt;Begin Use Case on Application Startup &lt;/span&gt;checkbox in Profiler page of &lt;span style="font-family:courier new;"&gt;Edit Run Configuration&lt;/span&gt; dialog (see Figure 5).&lt;br /&gt;&lt;br /&gt;If you want to analyze a specific method or class you might be interested in, enter the name of a particular method or class in your application in Method Filter (see Figure 5) at the options setting step.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-kSfk87IkRk4/TwSnTcYKmKI/AAAAAAAAAqk/Kbals5T3zaU/s1600/MethodFilter.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 287px;" src="http://2.bp.blogspot.com/-kSfk87IkRk4/TwSnTcYKmKI/AAAAAAAAAqk/Kbals5T3zaU/s400/MethodFilter.jpg" alt="" id="BLOGGER_PHOTO_ID_5693859781380053154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;References&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Oracle® Fusion Middleware User's Guide for Oracle JDeveloper 11g Release 2 (11.1.2.0.0) &lt;a href="http://docs.oracle.com/cd/E16162_01/user.1112/e17455/prog_java.htm#CHDJFEJH"&gt;Profiling a Project&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-6979171000536585290?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/bNi4iAnbpCk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/6979171000536585290/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=6979171000536585290" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/6979171000536585290?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/6979171000536585290?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/bNi4iAnbpCk/starting-cpu-profiler-in-jdeveloper.html" title="Starting the CPU Profiler in JDeveloper" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-hh_Y5OAf6UU/TwPrn2kVqRI/AAAAAAAAApo/tCealH9gHEQ/s72-c/CPU_Profiler.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2012/01/starting-cpu-profiler-in-jdeveloper.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIGRno4cSp7ImA9WhRQGEU.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-2776732587319041271</id><published>2011-12-04T09:05:00.002-08:00</published><updated>2011-12-14T10:32:07.439-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-14T10:32:07.439-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Scientific Visualization" /><category scheme="http://www.blogger.com/atom/ns#" term="MapReduce" /><category scheme="http://www.blogger.com/atom/ns#" term="Volume Rendering" /><category scheme="http://www.blogger.com/atom/ns#" term="Hadoop" /><title>Volume Rendering using MapReduce</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0WuIG6irANBTZqzwAYew3YUfeD8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0WuIG6irANBTZqzwAYew3YUfeD8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0WuIG6irANBTZqzwAYew3YUfeD8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0WuIG6irANBTZqzwAYew3YUfeD8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In [1], it has given a few examples of applications that can be easily expressed as &lt;span style="font-family:courier new;"&gt;MapReduce&lt;/span&gt; computations:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Distributed Grep&lt;/li&gt;&lt;li&gt;Count of URL Access Frequency&lt;/li&gt;&lt;li&gt;Reverse Web-Link Graph&lt;/li&gt;&lt;li&gt;Term-Vector per Host&lt;/li&gt;&lt;li&gt;Inverted Index&lt;/li&gt;&lt;/ol&gt;There  are many other applications that can be easily expressed in &lt;span style="font-family:courier new;"&gt;MapReduce  &lt;/span&gt;programming model.  In this article, we will show one of them — &lt;span style="font-weight: bold;"&gt;Volume Rendering&lt;/span&gt;.&lt;br /&gt;&lt;h3&gt;Applying MapReduce&lt;/h3&gt;To determine if &lt;span style="font-family:courier new;"&gt;MapReduce &lt;/span&gt;might be a potential solution to a concurrent programming.  Here are the questions to ask:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Does the algorithm break down into two separate phases (i.e., &lt;span style="font-family:courier new;"&gt;Map &lt;/span&gt;and Reduce)?&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Can the data be easily decomposed into equal-size partitions in the first phase (i.e., Map)?&lt;/li&gt;&lt;li&gt;Can  the same processing be applied to each partition, with no  dependencies  in the computations, and no communication required between  tasks in  the first phase?&lt;/li&gt;&lt;li&gt;Is there some “mapping” of data to keys involved? &lt;/li&gt;&lt;li&gt;Can you “reduce” the results of the first phase to compute the final answer(s)?&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;If all the answers are yes, you have an ideal candidate for the &lt;span style="font-family:courier new;"&gt;MapReduce &lt;/span&gt;computation.    In [2], Jeff A. Stuart et al. have demonstrated a multi-GPU parallel  volume rendering implementation built using the &lt;span style="font-family:courier new;"&gt;MapReduce programming model&lt;/span&gt;.&lt;br /&gt;&lt;h3&gt;Volume Rendering&lt;/h3&gt;In [2], Jeff A. Stuart el al. used a volume rendering  technique called &lt;span style="font-family:courier new;"&gt;segmented ray casting &lt;/span&gt;[5] (or &lt;span style="font-family:courier new;"&gt;ray partitioning &lt;/span&gt;[6]).&lt;br /&gt;&lt;br /&gt;In  [3,4], I and my colleagues have demonstrated an alternative way of parallel  implementation of volume rendering on &lt;span style="font-family:courier new;"&gt;Denali&lt;/span&gt;.  In Fig. 1, we see  that sample points along the rays with the same distance from the image  plane are in the same plane. So, instead of casting rays, we can  equally well sample the volume perpendicular to the viewing direction at  different distances from the image plane. This parallelization scheme  is called &lt;span style="font-family:courier new;"&gt;parallel plane cutting&lt;/span&gt;.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-cnCFNqawfGU/Ttu8ibVxkLI/AAAAAAAAAo4/McNhYwOMEAo/s1600/parallelPlaneCutting.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 221px;" src="http://4.bp.blogspot.com/-cnCFNqawfGU/Ttu8ibVxkLI/AAAAAAAAAo4/McNhYwOMEAo/s400/parallelPlaneCutting.jpg" alt="" id="BLOGGER_PHOTO_ID_5682342654498672818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Figure 1.  Parallel plane cutting vs. segmented ray casting&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In this article, I'll explore the possibility of adapting &lt;span style="font-family:courier new;"&gt;parallel plane cutting &lt;/span&gt;to &lt;span style="font-family:courier new;"&gt;MapReduce &lt;/span&gt;computation.&lt;br /&gt;&lt;h3&gt;MapReduce Basics&lt;sup&gt;[7,8]&lt;/sup&gt;&lt;br /&gt;&lt;/h3&gt;&lt;span style="font-family:courier new;"&gt;MapReduce &lt;/span&gt;is an algorithmic framework, like divide-and-conquer or backtracking.  Its model derives from the &lt;code&gt;map&lt;/code&gt; and &lt;code&gt;reduce&lt;/code&gt; combinators from a functional language like &lt;span style="font-family:courier new;"&gt;Lisp&lt;/span&gt;.  It is an abstraction that allows &lt;span style="font-family:courier new;"&gt;Google &lt;/span&gt;engineers to perform simple computations while hiding the details of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Parallelization &lt;/li&gt;&lt;li&gt;Data distribution &lt;/li&gt;&lt;li&gt;Load balancing &lt;/li&gt;&lt;li&gt;Fault tolerance&lt;/li&gt;&lt;/ul&gt;  A &lt;span style="font-family:courier new;"&gt;MapReduce job &lt;/span&gt;is a unit of work that the client wants to be performed: it consists of: &lt;ul&gt;&lt;li&gt;Input data&lt;/li&gt;&lt;li&gt;MapReduce program&lt;/li&gt;&lt;li&gt;Configuration information&lt;/li&gt;&lt;/ul&gt;The user configures and submits a &lt;span style="font-family:courier new;"&gt;MapReduce job &lt;/span&gt;to the framework (e.g., &lt;a href="http://en.wikipedia.org/wiki/Hadoop"&gt;Hadoop&lt;/a&gt;),  which will decompose the job into a set of map tasks, shuffles, a sort,  and a set of reduce tasks.   The framework will then manage the  distribution and execution of the tasks, collect the output, and report  the status to the user.&lt;br /&gt;&lt;br /&gt;A &lt;span style="font-family:courier new;"&gt;MapReduce job &lt;/span&gt;implemented in &lt;span style="font-family:courier new;"&gt;Hadoop &lt;/span&gt;is illustrated below:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-oqRq6t3vg_U/TtzrVMV1PFI/AAAAAAAAApQ/ZZokzo6AZhI/s1600/MapReduceJob.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 294px; height: 400px;" src="http://4.bp.blogspot.com/-oqRq6t3vg_U/TtzrVMV1PFI/AAAAAAAAApQ/ZZokzo6AZhI/s400/MapReduceJob.png" alt="" id="BLOGGER_PHOTO_ID_5682675579157298258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Figure 2.  Components of a Hadoop's MapReduce Job&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;sup&gt;[7]&lt;/sup&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt; The data flow of the model is shown in Figure 3.  This diagram shows why  the data flow between map and reduce tasks is colloquially known as  “&lt;span style="font-family:courier new;"&gt;the shuffle&lt;/span&gt;,” as each reduce task is fed by many map tasks.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-9qT9BUymYi0/TtvBiI_QINI/AAAAAAAAApE/Cscf9Qd5Ryk/s1600/MapReduce.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 218px;" src="http://2.bp.blogspot.com/-9qT9BUymYi0/TtvBiI_QINI/AAAAAAAAApE/Cscf9Qd5Ryk/s400/MapReduce.jpg" alt="" id="BLOGGER_PHOTO_ID_5682348147130507474" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Figure 3. Data Flow of MapReduce programming model&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Map and Reduce Tasks&lt;br /&gt;&lt;/h3&gt;In this article, we will use &lt;span style="font-family:courier new;"&gt;Hadoop &lt;/span&gt;as the framework for our design consideration.   Hadoop  supports the MapReduce model which was introduced by &lt;span style="font-family:courier new;"&gt;Google &lt;/span&gt;as a  method of  solving a class of petascale problems with large clusters of  inexpensive machines. Hadoop runs the &lt;span style="font-family:courier new;"&gt;MapReduce job &lt;/span&gt;by dividing it into tasks, of which there are two main types:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Map tasks&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Reduce tasks&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The idea behind &lt;span style="font-family:courier new;"&gt;map &lt;/span&gt;is to take a collection of data items and associate a value with each item in the collection. That is, to match up the elements of the input data with some relevant value to  produce a collection of &lt;span style="font-family:courier new;"&gt;key-value&lt;/span&gt; pairs. In terms of concurrency, the  operation of pairing up keys and values should be completely independent  for each element in the collection.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-family:courier new;"&gt;reduce &lt;/span&gt;operation takes all the pairs resulting from the &lt;span style="font-family:courier new;"&gt;map &lt;/span&gt;operation  and does a reduction computation on the collection.  The purpose of a  reduction is to take in a collection of data items and return a value  derived from those items. In more general terms, we can allow the reduce operation to return with zero, one, or any number of results. This will all depend on what the reduction operation is computing and the input data from the map operation.&lt;br /&gt;&lt;h3&gt;Data Decomposition&lt;br /&gt;&lt;/h3&gt;As shown in Figure 2, the first design consideration is &lt;span style="font-family:courier new;"&gt;data composition &lt;/span&gt;(or &lt;span style="font-family:courier new;"&gt;split&lt;/span&gt;).  There are at least two factors to be considered:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data locality&lt;/li&gt;&lt;li&gt;Task granularity vs. parallel overhead cost&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; &lt;span style="font-family:courier new;"&gt;Data locality &lt;/span&gt;promotes performance.   Hadoop does its best to run the map task on a node where the input data resides in (&lt;span style="font-family:courier new;"&gt;Hadoop Distributed Filesystem&lt;/span&gt;) &lt;span style="font-weight: bold;"&gt;HDFS&lt;/span&gt;.   However, reduce tasks don’t have the advantage of data locality—the  input to a single reduce task is normally the output from all mappers.  For our volume rendering example, local sub-volume data will help the performance of map tasks.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Fine-grain parallelism &lt;/span&gt;allows for a more uniform distribution of load among nodes, but has the potential for a significant overhead.  On the other hand, &lt;span style="font-family:courier new;"&gt;Coarse-grain parallelism &lt;/span&gt;incurs a small overhead, but may not produce a balanced loading.  For our volume rendering, there will be an optimal sub-volume size (TBD) that incurs a smaller overhead while produces a better load balancing.&lt;br /&gt;&lt;h3&gt;InputFormat&lt;/h3&gt;In &lt;span style="font-family:courier new;"&gt;Hadoop &lt;/span&gt;(see Figure 2), user-provided  &lt;span style="font-family:courier new;"&gt;InputFormat &lt;/span&gt;can be used for custom data decomposition.  An &lt;span style="font-family:courier new;"&gt;InputFormat &lt;/span&gt;describes both how to present the data to the Mapper and where the data originates from.  An important job of the &lt;i&gt;InputFormat&lt;/i&gt; is to divide   the input data sources (e.g., input files) into fragments   that make up the inputs to individual map tasks. These fragments   are called &lt;span style="font-family:courier new;"&gt;splits &lt;/span&gt;and are encapsulated in instances of the   &lt;i&gt;InputSplit&lt;/i&gt; interface.&lt;br /&gt;&lt;br /&gt;In the &lt;span style="font-family:courier new;"&gt;parallel cutting plane &lt;/span&gt;approach, we subdivide volume into sub-volumes for the rendering.  Volume data can be stored in different formats.  To simplify this discussion, we assume our input data are stored in sub-volumes (i.e., voxels belonging to the same sub-volume are stored consecutively and in an individual file).&lt;br /&gt;&lt;br /&gt;Objects which can be marshaled to or from files and across   the network must obey a particular interface, called &lt;span style="font-family:courier new;"&gt;Writable&lt;/span&gt;,   which allows &lt;span style="font-family:courier new;"&gt;Hadoop   &lt;/span&gt;to read and write the data in a serialized form for transmission.   If the Objects are Keys,&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;WritableComparable &lt;/span&gt;interface should be used instead.&lt;br /&gt;&lt;br /&gt;To support our volume renderer, a custom &lt;span style="font-family:courier new;"&gt;InputFormat &lt;/span&gt;with two custom data types (i.e., &lt;span style="font-family:courier new;"&gt;SubVolumeKey &lt;/span&gt;and &lt;span style="font-family:courier new;"&gt;SubVolumeValue&lt;/span&gt;) needs to be created.  A high level description of the implementation is provided below:&lt;br /&gt;&lt;pre class="codeblue"&gt;public class VolumeInputFormat extends&lt;br /&gt;SequenceFileInputFormat&lt;subvolumnekey, subvolumevalue=""&gt; {&lt;br /&gt;&lt;br /&gt;public RecordReader&lt;subvolumnekey, subvolumevalue=""&gt; getRecordReader(&lt;br /&gt;InputSplit input, JobConf job, Reporter reporter)&lt;br /&gt;throws IOException {&lt;br /&gt;&lt;br /&gt;reporter.setStatus(input.toString());&lt;br /&gt;return new VolumeRecordReader(job, (FileSplit)input);&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;}&lt;/subvolumnekey,&gt;&lt;/subvolumnekey,&gt;&lt;/pre&gt;The &lt;span style="font-family:courier new;"&gt;RecordReader&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;implementation is where the actual   file information is read and parsed.&lt;br /&gt;&lt;br /&gt;&lt;pre class="codeblue"&gt;class VolumeRecordReader implements RecordReader&lt;subvolumekey, subvolumevalue=""&gt; {&lt;br /&gt;&lt;br /&gt;public VolumeRecordReader (JobConf job, FileSplit split) throws IOException {&lt;br /&gt;..&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public boolean next(SubVolumeKey key, SubVolumeValue value) throws IOException {&lt;br /&gt;// get next sub-volume&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Text createKey() {&lt;br /&gt;return new SubVolumeKey();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Point3D createValue() {&lt;br /&gt;return new SubVolumeValue ();&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;}&lt;/subvolumekey,&gt;&lt;/pre&gt;In &lt;span style="font-family:courier new;"&gt;SubVolumeKey&lt;/span&gt;, you need to provide the following minimum information:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;2D footprint offset (&lt;span style="font-weight: bold;"&gt;Fx&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Fy&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;Transformation matrix (&lt;span style="font-weight: bold;"&gt;M&lt;/span&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;3D sub-volume offset (&lt;span style="font-weight: bold;"&gt;Vx&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Vy&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Vz&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;Resampling mode (&lt;span style="font-weight: bold;"&gt;R&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;3D Zooming and 2D Scaling factors (&lt;span style="font-weight: bold;"&gt;Z &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;S&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;Projection function (&lt;span style="font-weight: bold;"&gt;P&lt;/span&gt;; for example &lt;span style="font-family:courier new;"&gt;max &lt;/span&gt;operation)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Resampling of sub-volumes on each cutting plane can be done independently as long as we can provide sufficient information as shown in the sample &lt;span style="font-family:courier new;"&gt;SubVolumeKey &lt;/span&gt;to each map task.  For the detailed description of &lt;span style="font-family:courier new;"&gt;SubVolumeKey's&lt;/span&gt; parameters, refer to [3,4].&lt;br /&gt;&lt;h3&gt;Map Function&lt;/h3&gt;In this article, we will use &lt;span style="font-family:courier new;"&gt;Maximum Intensity Projection &lt;/span&gt;(MIP)  as our volume rendering example.  In &lt;a href="http://en.wikipedia.org/wiki/Scientific_visualization"&gt;scientific visualization&lt;/a&gt;, MIP is a  volume rendering method for 3D data that projects in the visualization  plane the voxels with maximum intensity that fall in the way of parallel  rays traced from the viewpoint to the plane of projection.&lt;br /&gt;&lt;br /&gt;Same principles used for MIP can be applied to &lt;span style="font-family:courier new;"&gt;Isosurface Rendering&lt;/span&gt; (&lt;span style="font-weight: bold;"&gt;SR&lt;/span&gt;).   In SR, a Z-buffer or depth matrix is generated as the result. This matrix is  actually a 2D image whose values are the depth values at which an  isosurface threshold occurs for a given viewing direction. A shading  procedure using &lt;span style="font-family:courier new;"&gt;depth-gradient shading &lt;/span&gt;is then applied to generate a colored image.&lt;br /&gt;&lt;br /&gt;In [3], we have demonstrated other parallel volume rendering methods too:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Multi-Planar Reformatting&lt;/li&gt;&lt;li&gt;Volume Resampling&lt;/li&gt;&lt;li&gt;&lt;span&gt;Ray Sum&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;MIP  has a nice property—you can apply the reduction computations to  individual items and partial results of previous reductions:&lt;br /&gt;&lt;ul  style="font-family:courier new;"&gt;&lt;li&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-size:medium;" &gt;max(0, 20, 10, 25, 15) = max(max(0, 20, 10), max(25, 15)) = max(20, 25) = 25&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;The map task of volume rendering is to generate 2D footprints out of a given sub-volume.  To perform projection, we apply the transformation matrix (&lt;span style="font-weight: bold;"&gt;M&lt;/span&gt;) to the volume coordinates (&lt;span style="font-weight: bold;"&gt;Vx&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Vy&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Vz&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;and find the bounding box of each sub-volume. Based on the bounding box and zooming factor (&lt;span style="font-weight: bold;"&gt;Z&lt;/span&gt;), we can find out number of cutting planes need to be sampled in the sub-volume.  In &lt;span style="font-family:courier new;"&gt;x&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;y &lt;/span&gt;directions, all coordinates are rounded or truncated to the closest discrete pixel position in the image plane. In &lt;span style="font-family:courier new;"&gt;z &lt;/span&gt;direction, we define discrete plane levels (not necessary integer coordinates) and all coordinates are rounded or truncated to the closest plane level. After the adjustment of the coordinates of the bounding box as described above, we sample the bounding box of the sub-volume via plane cutting.&lt;br /&gt;&lt;br /&gt;For MIP, the map task includes the following sub-tasks:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Resample voxels on each cutting plane&lt;/li&gt;&lt;li&gt;Prepare intermediate results for the consumption of reduce tasks&lt;/li&gt;&lt;/ul&gt;Each map task will generate as many 2D footprints as required to be sent to reduce tasks.  3D resampling can be done in either &lt;span style="font-family:courier new;"&gt;point sampling &lt;/span&gt;or &lt;span style="font-family:courier new;"&gt;linear interpolation&lt;/span&gt;.  The projected footprint will then be scaled based on the 2D scaling factor (&lt;span style="font-weight: bold;"&gt;S&lt;/span&gt;) before being sent out.&lt;h3&gt;Sort and Shuffle&lt;br /&gt;&lt;/h3&gt;Custom data types are needed for the intermediate results (i.e., 2D image tiles):&lt;br /&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;SubImageKey&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;SubImageValue&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In &lt;span style="font-family:courier new;"&gt;SubImageKey&lt;/span&gt;, you need to provide the following minimum information:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;2D footprint offset (&lt;span style="font-weight: bold;"&gt;Fx&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Fy&lt;/span&gt;)&lt;/li&gt;&lt;li&gt;Projection function (&lt;span style="font-weight: bold;"&gt;P&lt;/span&gt;; for example &lt;span style="font-family:courier new;"&gt;max &lt;/span&gt;operation)&lt;/li&gt;&lt;li&gt;2D footprint distance (&lt;span style="font-weight: bold;"&gt;Fz&lt;/span&gt;; but this is not needed in MIP)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The implementation of &lt;span style="font-family:courier new;"&gt;compareTo &lt;/span&gt;method in &lt;span style="font-family:courier new;"&gt;SubImageKey&lt;/span&gt;, which implements a &lt;span style="font-family:courier new;"&gt;WritableComparable &lt;/span&gt;interface, should use (&lt;span style="font-weight: bold;"&gt;Fx, Fy&lt;/span&gt;) in the comparison for the shuffle or sort.  For MIP, the ordering of intermediate results doesn't matter. &lt;h3&gt;Reduce Function&lt;/h3&gt;The footprint of each sub-volume after projection is a 2D image tile. In Figure 4, we see that image tiles may overlay each other. The final image is created by recombining image tiles.  Therefore alignment of image tiles in the projection and recombination process is an important task in this work.  If not correct, you may introduce artifacts into the final image.  For medical imaging, none of such artifacts can be tolerated.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-B_oTGvTx-nM/Tt_iCgI_dxI/AAAAAAAAApc/YGJb04Hf-qw/s1600/Recombination.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 221px;" src="http://3.bp.blogspot.com/-B_oTGvTx-nM/Tt_iCgI_dxI/AAAAAAAAApc/YGJb04Hf-qw/s400/Recombination.png" alt="" id="BLOGGER_PHOTO_ID_5683509787380119314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Figure 4.  Projection and Recombination&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;For MIP, the reduce task includes the following sub-tasks:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Apply projection function (i.e., &lt;span style="font-family:courier new;"&gt;max&lt;/span&gt;) to each pixels on the intermediate results&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Assemble the final image in a global output file with a specified format.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Conclusion&lt;br /&gt;&lt;/h3&gt;  For a &lt;span style="font-family:courier new;"&gt;divide-and-conquer &lt;/span&gt;approach, the construction of the final image requires a number of stages. Image tiles of individual sub-volumes are generated after sampling and blending. A recombination process which takes care of pixel alignments is used to place these tiles into the final image under a specific merging condition. Finally, a post-rendering process called &lt;span style="font-family:courier new;"&gt;Z merging&lt;/span&gt;, with a depth compare done upon merging, can be used to integrate volume images with 3D graphics.&lt;br /&gt;&lt;br /&gt;Finally, I want to use this article to pay tribute to Dr. &lt;a href="http://en.wikipedia.org/wiki/Bruce_H._McCormick"&gt;Bruce H. McCormick &lt;/a&gt;(1928 - 2007) who is my most respected college professor and Ph.D. adviser.&lt;br /&gt;&lt;h3&gt;References&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://code.google.com/edu/parallel/mapreduce-tutorial.html"&gt;Introduction to Parallel Programming and MapReduce&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCMQFjAA&amp;amp;url=http%3A%2F%2Fwww.idav.ucdavis.edu%2Ffunc%2Freturn_pdf%3Fpub_id%3D1004&amp;amp;ei=GqzbTtymM4rWiAKx-oS8CQ&amp;amp;usg=AFQjCNH26zbmILdtB2lduBnsFRKuj9GUMw"&gt;Mult-GPU Volumne Rendering using MapReduce&lt;/a&gt;&lt;/li&gt;&lt;li&gt;S. Y. Guan and R. Lipes, “Innovative Volume Kendering Using 3D Texture Mapping,” &lt;span style="font-style: italic;"&gt;Proceedings of Medical imaging 1996-Image Capture. Formatting, and Display&lt;/span&gt;, vol. 2 164. pp. 382-392, Feb. 1994.&lt;/li&gt;&lt;li&gt;S. Y. Guan, Bleiweiss, A., Lipes, R. “Parallel Implementation of Volume Rendering on Denali Graphics Systems,”  &lt;span style="font-style: italic;"&gt;Parallel Processing Symposium, 1995. &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Proceedings., 9th International&lt;/span&gt;, pp. 700-706,1995.&lt;/li&gt;&lt;li&gt;E. Camahort and I. Chakravmty, “Integrating Volume Data Analysis and Rendering on Distributed Memory Architectures,” &lt;span style="font-style: italic;"&gt;Proceedings of 1993 Parallel Rendering Symposium&lt;/span&gt;, pp. 89-96, San Jose. CA, Oct. 1993.&lt;/li&gt;&lt;li&gt;W. M. Hsu, “Segmented Ray Casting for Data Parallel Volume Rendering,” &lt;span style="font-style: italic;"&gt;Proceedings of 1993 Parallel Rendering Symposium&lt;/span&gt;. pp. 7-14, San Jose, CA, Oct. 1993.&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Pro Hadoop &lt;/span&gt;by Json Venner&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Hadoop: The Definitive Guide&lt;/span&gt;, Second Edition by Tom White&lt;/li&gt;&lt;li&gt;&lt;a href="http://developer.yahoo.com/hadoop/tutorial/"&gt;Yahoo! Hadoop Tutorial&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-2776732587319041271?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/Q8dpsyL4xzs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/2776732587319041271/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=2776732587319041271" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2776732587319041271?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2776732587319041271?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/Q8dpsyL4xzs/volume-rendering-using-mapreduce.html" title="Volume Rendering using MapReduce" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-cnCFNqawfGU/Ttu8ibVxkLI/AAAAAAAAAo4/McNhYwOMEAo/s72-c/parallelPlaneCutting.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/12/volume-rendering-using-mapreduce.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4GRXk5fyp7ImA9WhRTFUg.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-2020998272670266225</id><published>2011-11-05T13:25:00.000-07:00</published><updated>2011-11-05T22:38:44.727-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-05T22:38:44.727-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Design Pattern" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Fusion Web Applications" /><category scheme="http://www.blogger.com/atom/ns#" term="Sub-Flow" /><title>Sub-flow Design Pattern</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/euVtvPwkhcRFBQ3KXleSFxTGv0o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/euVtvPwkhcRFBQ3KXleSFxTGv0o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/euVtvPwkhcRFBQ3KXleSFxTGv0o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/euVtvPwkhcRFBQ3KXleSFxTGv0o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;A &lt;span style="font-weight: bold;"&gt;design pattern &lt;/span&gt;is a formal documentation of a proven solution to a common problem.  Within Oracle Fusion Web Applications&lt;sup&gt;[1]&lt;/sup&gt;, there are many design patterns embedded in their design.  One of them is sub-flow design pattern.&lt;br /&gt;&lt;br /&gt;Before you start, read this companion &lt;a href="http://xmlandmore.blogspot.com/2010/05/opensubtask-and-closesubtask-apis.html"&gt;article &lt;/a&gt;first.&lt;br /&gt;&lt;h3&gt;Usage&lt;/h3&gt;In &lt;span style="font-weight: bold;"&gt;sub-flow design pattern&lt;/span&gt;, there are two task flows involved:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Parent task flow (top-level)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Sub-flow&lt;/li&gt;&lt;/ul&gt;In Oracle Fusion Web Applications, all top-level task flows can be bookmarked and be launched from either task list or Recent Items menu.  However, if the application requires that sub-flows can also be bookmarked and be launched from Recent Items menu.  Then this sub-flow design pattern can be utilized for that functionality.&lt;br /&gt;&lt;br /&gt;If sub-flows are bookmarked, it can be relaunched from Recent Items menu. In the sub-flows, it's required that users can also navigate back to its parent flow.  Sub-flow design pattern also takes that into consideration.&lt;br /&gt;&lt;div&gt; &lt;div&gt; &lt;h3&gt;Overview&lt;/h3&gt;&lt;p&gt;To record sub-flows into the Recent Items list, applications need to call&lt;span style="font-family:Courier;"&gt; openSubTask &lt;/span&gt;API right before sub-flows are launched&lt;sup&gt;[2]&lt;/sup&gt;. &lt;span style="font-family:Courier;"&gt;openSubTask &lt;/span&gt;takes parameters similar to  &lt;span style="font-family:Courier;"&gt;openMainTask's&lt;/span&gt;. One of them is &lt;em&gt;task flow ID&lt;/em&gt;.  For this, you need to specify parent flow's ID (or main task's ID). In  other words, sub-flows need to be executed via parent flow even they are  launched from Recent Items menu.  See Sample Implementation section  for details.&lt;/p&gt; &lt;p&gt;If your sub-flow doesn't need to be bookmarked by Recent Items, you  don't need to change anything. Otherwise, you need to modify your parent  flow and sub-flow as described in the following task.  After the  changes, sub-flows can be launched in two ways:&lt;/p&gt;&lt;/div&gt; &lt;ol&gt;&lt;li&gt;From original flows &lt;/li&gt;&lt;li&gt;From Recent Items menu items using recorded information&lt;/li&gt;&lt;/ol&gt; &lt;div&gt;Both will start the execution in parent flow. Because sub-flow  needs to be launched via parent flow in the 2nd case above, you need to  change parent flow in this way: &lt;/div&gt; &lt;ol&gt;&lt;li&gt;Add a new router activity at the beginning of the parent flow. Based  on a test condition (to be described later), it will route the control  to either the original parent flow or the &lt;span style="font-family:Courier;"&gt;task flow call activity&lt;/span&gt; (i.e.,  the sub-flow). &lt;/li&gt;&lt;li&gt;Add an optional method call activity to initialize sub-flow before  it's launched for the 2nd case (i.e., launching from Recent Items  menu). Fusion developers can code the method in such a way that it can  navigate to the sub-flow after initializing the parent state. This  allows applications to render contextual area, navigating back to  parent flow from sub-flow and any other customizations. &lt;/li&gt;&lt;li&gt;Bind &lt;em&gt;openSubTask&lt;/em&gt; to the command component (i.e., link or  button) which causes the flow navigate to the &lt;span style="font-family:Courier;"&gt;task flow call activity&lt;/span&gt; in  the original parent flow. &lt;em&gt;openSubTask&lt;/em&gt; API registers the parent flow details (to be launched as a sub-flow later) to the Applications Core task flow history stack. &lt;/li&gt;&lt;/ol&gt; &lt;div&gt;Usually, you don't need to modify your sub-flow for this task.  However, you can consolidate the initialization steps from two execution  paths in such a way: &lt;/div&gt; &lt;ol&gt;&lt;li&gt;Remove initialization parts from both paths in the parent flow. Instead set input parameters (which to be used as test conditions in sub-flows) in both paths only. &lt;/li&gt;&lt;li&gt;Modify sub-flow to take input parameters. &lt;/li&gt;&lt;li&gt;Add a new method call (say &lt;em&gt;initSubFlow&lt;/em&gt;) at beginning of the  sub-flow to initialize states in parent flow (for example, parent table)  so that sub-flow can be launched in the appropriate context.&lt;/li&gt;&lt;/ol&gt; &lt;div&gt; &lt;p&gt;Note that the design pattern also requires the application capable of  navigating back to parent flow from sub-flow.  So, the initialization code should take this into consideration (i.e.,  set up states to allow sub-flow to navigate back) too.&lt;/p&gt; &lt;p&gt;In the following, we'll use an Employee sample implementation to  demonstrate the details of this design pattern.  &lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;h3&gt;Sample Implementation&lt;/h3&gt; &lt;div&gt; &lt;p&gt;In this Fusion Web Application, users select &lt;span style="font-family:Courier;"&gt;Subflow Design Pattern&lt;/span&gt;  from the Task list. They then specify some criteria for searching a  specific employee or employees. From the list, they can choose the  employee that they want to show the details for. This procedure is  demonstrated in the following screen shots: &lt;/p&gt;&lt;/div&gt; &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/-IDbtkHUvPUw/TrXKJ4P8FbI/AAAAAAAAAog/qkdinbJpOaU/s1600/sub-flow3.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 205px;" src="http://3.bp.blogspot.com/-IDbtkHUvPUw/TrXKJ4P8FbI/AAAAAAAAAog/qkdinbJpOaU/s400/sub-flow3.png" alt="" id="BLOGGER_PHOTO_ID_5671661576809878962" border="0" /&gt;&lt;/a&gt;&lt;img src="file:///C:/Users/SGUAN%7E1.ST-/AppData/Local/Temp/moz-screenshot-48.png" alt="" /&gt;&lt;em&gt;Ename&lt;/em&gt; in the search result table is a link which can be used   to navigate to the employee detail page of a specific employee. When   this link is clicked, a sub-flow (or nested bounded task flow) is called   and it displays the &lt;span style="font-family:Courier;"&gt;Employee Complete Detail&lt;/span&gt; page.&lt;/p&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/-W6DzN8i1sAo/TrXKeutXcHI/AAAAAAAAAos/dvWylBvpSAQ/s1600/sub-flow4.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 203px;" src="http://1.bp.blogspot.com/-W6DzN8i1sAo/TrXKeutXcHI/AAAAAAAAAos/dvWylBvpSAQ/s400/sub-flow4.png" alt="" id="BLOGGER_PHOTO_ID_5671661935026204786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;If users would like to add this &lt;span style="font-family:Courier;"&gt;Employee Complete Detail&lt;/span&gt;  page of a specific employee (say, employee named 'Allen') to their Recent Items list, application developers need to set up something extra to make this  happen. If this page (actually what gets recorded is a bounded task flow  whose default page is displayed) has been bookmarked, next time users  can click it on the Recent Items menu and launch it directly by  skipping the search step (i.e., identify the Employee whose details need  to be displayed).&lt;/p&gt; &lt;h3&gt;Implementation Details&lt;/h3&gt; &lt;div&gt;Our parent task flow named &lt;span style="font-family:Courier;"&gt;ToParentSFFlow&lt;/span&gt; is shown below:&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-1VMiZhgDP1I/TrW4vTXSysI/AAAAAAAAAoI/FEJCQGxjwQk/s1600/sub-flow1.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 272px;" src="http://3.bp.blogspot.com/-1VMiZhgDP1I/TrW4vTXSysI/AAAAAAAAAoI/FEJCQGxjwQk/s400/sub-flow1.png" alt="" id="BLOGGER_PHOTO_ID_5671642428534344386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;em&gt; &lt;/em&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:Courier;"&gt;decideFlow&lt;/span&gt; in the diagram is the router activity that decides whether the control flow should go to either  original parent flow path (i.e., "&lt;span style="font-family:Courier;"&gt;initParent&lt;/span&gt;") or sub-flow path (i.e., "&lt;span style="font-family:Courier;"&gt;toChild&lt;/span&gt;"). The condition we used is defined as follows:&lt;/div&gt; &lt;div style="border-width: 1px;" class="code panel"&gt; &lt;div class="codeContent panelContent"&gt; &lt;pre class="code-java"&gt;&lt;router id="decideFlow"&gt;&amp;lt;router id="decideFlow"&amp;gt;&lt;br /&gt; &amp;lt;case&amp;gt;&lt;br /&gt;   &amp;lt;expression&amp;gt;#{pageFlowScope.Empno == null}&amp;lt;/expression&amp;gt;&lt;br /&gt;   &amp;lt;outcome id="__9"&amp;gt;initParent&amp;lt;/outcome&amp;gt;&lt;br /&gt; &amp;lt;/case&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;case&amp;gt;&lt;br /&gt;   &amp;lt;expression&amp;gt;#{pageFlowScope.Empno != null}&amp;lt;/expression&amp;gt;&lt;br /&gt;   &amp;lt;outcome id="__10"&amp;gt;toChild&amp;lt;/outcome&amp;gt;&lt;br /&gt; &amp;lt;/case&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;default-outcome&amp;gt;initParent&amp;lt;/default-outcome&amp;gt;&lt;br /&gt;&amp;lt;/router&amp;gt;&lt;br /&gt;&lt;/router&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;In the test, we check whether &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt; variable in the parent flow's pageFlowScope is null or not. #{&lt;span style="font-family:Courier;"&gt;pageFlowScope.Empno&lt;/span&gt;} is set via its input parameter &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt; when parent flow is called . The input parameters on the parent flow (i.e., &lt;em&gt;ToParentSFFlow&lt;/em&gt;) is defined as follows:&lt;/p&gt; &lt;div&gt;&lt;pre class="code-java"&gt;&lt;input-parameter-definition&gt;&amp;lt;input-parameter-definition&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;Empno&amp;lt;/name&amp;gt;&lt;br /&gt;  &amp;lt;value&amp;gt;#{pageFlowScope.Empno}&amp;lt;/value&amp;gt;&lt;br /&gt;  &amp;lt;class&amp;gt;java.lang.String&amp;lt;/class&amp;gt;&lt;br /&gt;&amp;lt;/input-parameter-definition&amp;gt;&lt;br /&gt;&lt;class&gt;&lt;/class&gt;&lt;br /&gt;&lt;/input-parameter-definition&gt; &lt;/pre&gt;&lt;/div&gt; &lt;p&gt;When parent flow is launched from Task List, parameter &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt; is not set (i.e., not defined in the Application menu's &lt;span style="font-style: italic;"&gt;itemNode&lt;/span&gt;). Therefore, it's null and router will route it to "&lt;span style="font-family:Courier;"&gt;initParent&lt;/span&gt;" path.&lt;/p&gt; &lt;p&gt;When sub-flow is recorded via &lt;span style="font-family:Courier;"&gt;openSubTask&lt;/span&gt; API, we set &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt; on the &lt;span style="font-family:Courier;"&gt;parametersList&lt;/span&gt; as follows:&lt;/p&gt; &lt;div&gt;&lt;pre class="code-java"&gt;&lt;methodaction id="openSubTask" requiresupdatemodel="true" action="invokeMethod" methodname="openSubTask" isviewobjectmethod="false" datacontrol="FndUIShellController" instancename="FndUIShellController.dataProvider" returnname="FndUIShellController.methodResults.openSubTask_FndUIShellController_dataProvider_openSubTask_result"&gt;&amp;lt;methodAction id="openSubTask" RequiresUpdateModel="true"&lt;br /&gt;                 Action="invokeMethod" MethodName="openSubTask"&lt;br /&gt;                 IsViewObjectMethod="false" DataControl="FndUIShellController"&lt;br /&gt;                 InstanceName="FndUIShellController.dataProvider"&lt;br /&gt;                 ReturnName="FndUIShellController.methodResults.openSubTask_FndUIShellController_dataProvider_openSubTask_result"&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="taskFlowId" NDType="java.lang.String"&lt;br /&gt;         NDValue="/WEB-INF/oracle/apps/xteam/demo/ui/flow/ToParentSFContainerFlow.xml#ToParentSFContainerFlow"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="parametersList" NDType="java.lang.String"&lt;br /&gt;                NDValue="Empno=#{row.Empno}"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="label" NDType="java.lang.String"&lt;br /&gt;                NDValue="#{row.Ename} complete details"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="keyList" NDType="java.lang.String"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="taskParametersList" NDType="java.lang.String"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="viewId" NDType="java.lang.String"&lt;br /&gt;                NDValue="/DemoWorkArea"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="webApp" NDType="java.lang.String"&lt;br /&gt;                NDValue="DemoAppSource"/&amp;gt;&lt;br /&gt;     &amp;lt;NamedData NDName="methodParameters"&lt;br /&gt;         NDType="oracle.apps.fnd.applcore.patterns.uishell.ui.bean.FndMethodParameters"/&amp;gt;&lt;br /&gt;&amp;lt;/methodAction&amp;gt;&lt;nameddata ndname="taskFlowId" ndtype="java.lang.String" ndvalue="/WEB-INF/oracle/apps/xteam/demo/ui/flow/ToParentSFContainerFlow.xml#ToParentSFContainerFlow"&gt;&lt;nameddata ndname="parametersList" ndtype="java.lang.String" ndvalue="Empno=#{row.Empno}"&gt;&lt;nameddata ndname="label" ndtype="java.lang.String" ndvalue="#{&amp;lt;font " style=""&gt;&lt;nameddata ndname="keyList" ndtype="java.lang.String"&gt;&lt;nameddata ndname="taskParametersList" ndtype="java.lang.String"&gt;&lt;nameddata ndname="viewId" ndtype="java.lang.String" ndvalue="/DemoWorkArea"&gt;&lt;nameddata ndname="webApp" ndtype="java.lang.String" ndvalue="DemoAppSource"&gt;&lt;nameddata ndname="methodParameters" ndtype="oracle.apps.fnd.applcore.patterns.uishell.ui.bean.FndMethodParameters"&gt;&lt;br /&gt;&lt;/nameddata&gt; &lt;/nameddata&gt;&lt;/nameddata&gt;&lt;/nameddata&gt;&lt;/nameddata&gt;&lt;/nameddata&gt;&lt;/nameddata&gt;&lt;/nameddata&gt;&lt;/methodaction&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;We also set up:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;taskFlowId &lt;/span&gt;to be parent flow's, not subflow's &lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;label &lt;/span&gt;to be subflow's&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;When end users click on the link (i.e., &lt;span style="font-family:Courier;"&gt;Ename&lt;/span&gt;), which the &lt;span style="font-style: italic;"&gt;openSubTask &lt;/span&gt;method is bound to, &lt;span style="font-style: italic;"&gt;openSubTask &lt;/span&gt;will be called. This link component is defined as follows:&lt;/p&gt; &lt;div&gt;&lt;pre class="code-java"&gt;&lt;af:column sortproperty="Ename" sortable="false" headertext="#{bindings.ComplexSFEmpVO.hints.Ename.label}" id="resId1c2"&gt;&amp;lt;af:column sortProperty="Ename" sortable="false"&lt;br /&gt;           headerText="#{bindings.ComplexSFEmpVO.hints.Ename.label}"&lt;br /&gt;           id="resId1c2"&amp;gt;&lt;br /&gt;  &amp;lt;af:commandLink id="ot3" text="#{row.Ename}"&lt;br /&gt;                  actionListener="#{bindings.openSubTask.execute}"&lt;br /&gt;                  disabled="#{!bindings.openSubTask.enabled}"&lt;br /&gt;                  action="toChild"&amp;gt;&lt;br /&gt;    &amp;lt;af:setActionListener from="#{row.Empno}"&lt;br /&gt;                          to="#{pageFlowScope.Empno}"/&amp;gt;&lt;br /&gt;  &amp;lt;/af:commandLink&amp;gt;&lt;br /&gt;&amp;lt;/af:column&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;af:commandlink id="ot3" text="#{row.Ename}" actionlistener="#{bindings.&amp;lt;font " style=""&gt;&lt;br /&gt;&lt;/af:commandlink&gt; &lt;/af:column&gt;&lt;/pre&gt;&lt;/div&gt; &lt;p&gt;Note that when the link is clicked, &lt;span style="font-family:Courier;"&gt;actionListener&lt;/span&gt; and &lt;span style="font-family:Courier;"&gt;action&lt;/span&gt; specified on the link are executed and in that order. Also note that &lt;span style="font-style: italic;"&gt;openSubTask &lt;/span&gt;needs to be called only from the original parent flow path (i..e, "&lt;span style="font-family:Courier;"&gt;initParent&lt;/span&gt;"), not sub-flow path(i.e., "&lt;span style="font-family:Courier;"&gt;toChild&lt;/span&gt;). &lt;/p&gt; &lt;p&gt;&lt;span style="font-family:Courier;"&gt;EmployeeeDetails&lt;/span&gt; activity in the above figure is a &lt;span style="font-family:Courier;"&gt;Task Flow Call&lt;/span&gt; activity which invokes our sub-flow (i.e., &lt;span style="font-family:Courier;"&gt;ToChildSFFlow&lt;/span&gt;).  Before sub-flow is executed, you need to add some initialization steps.  These initialization steps could include, but not limited to:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Set up parent states. For our example, we need to set selected employee's row to be current. &lt;/li&gt;&lt;li&gt;Set up contextual area state. &lt;/li&gt;&lt;li&gt;Set up states to allow sub-flow to navigate back to parent flow.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;There are two approaches to set up initialization steps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;In the parent flow &lt;/li&gt;&lt;li&gt;In the sub-flow&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;For the first approach, you can add logic to initialize both paths  before the &lt;span style="font-family:Courier;"&gt;task flow call activity&lt;/span&gt; in the parent flow. For the second  approach, you initialize states in the sub-flow by using input  parameters of the sub-flow. For example, in our example, sub-flow will  take an input parameter named &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt;. So, the second approach just postpone the initialization to the sub-flow.&lt;/p&gt; &lt;p&gt;Let's see how input parameters are defined in &lt;span style="font-family:Courier;"&gt;Task Flow Call&lt;/span&gt; activity and sub-flow.&lt;/p&gt; &lt;p&gt;Here is the definition of input parameters in our &lt;span style="font-family:Courier;"&gt;Task Flow Call&lt;/span&gt; activity:&lt;br /&gt;&lt;/p&gt; &lt;div&gt;&lt;pre class="code-java"&gt;&lt;task-flow-call id="EmployeeDetails"&gt;&lt;task-flow-reference&gt;&lt;br /&gt;&lt;document&gt;&amp;lt;task-flow-call id="EmployeeDetails"&amp;gt;&lt;br /&gt;     &amp;lt;task-flow-reference&amp;gt;&lt;br /&gt;       &amp;lt;document&amp;gt;/WEB-INF/oracle/apps/xteam/demo/ui/flow/ToChildSFFlow.xml&amp;lt;/document&amp;gt;&lt;br /&gt;       &amp;lt;id&amp;gt;ToChildSFFlow&amp;lt;/id&amp;gt;&lt;br /&gt;     &amp;lt;/task-flow-reference&amp;gt;&lt;br /&gt;     &amp;lt;input-parameter&amp;gt;&lt;br /&gt;       &amp;lt;name&amp;gt;Empno&amp;lt;/name&amp;gt;&lt;br /&gt;       &amp;lt;value&amp;gt;#{pageFlowScope.Empno}&amp;lt;/value&amp;gt;&lt;br /&gt;     &amp;lt;/input-parameter&amp;gt;&lt;br /&gt;&amp;lt;/task-flow-call&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/document&gt;&lt;/task-flow-reference&gt;&lt;input-parameter&gt;&lt;value&gt;&lt;/value&gt;&lt;br /&gt;&lt;/input-parameter&gt;&lt;br /&gt;&lt;/task-flow-call&gt; &lt;/pre&gt;&lt;/div&gt; &lt;p&gt;Note that this means that the calling task flow needs to store the value of &lt;span style="font-style: italic;"&gt;Empno &lt;/span&gt;in #{&lt;span style="font-family:Courier;"&gt;pageFlowScope.Empno&lt;/span&gt;}. For example, from the original parent flow path, it is set to be #{&lt;span style="font-family:Courier;"&gt;row.Empno&lt;/span&gt;} using &lt;span style="font-style: italic;"&gt;setActionListener &lt;/span&gt;tag. For the sub-flow path, it is set using parent flow's input parameter named &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt;. On the sub-flow, we need to specify its input parameters as below:&lt;/p&gt; &lt;div&gt;&lt;pre class="code-java"&gt;&lt;task-flow-definition id="ToChildSFFlow"&gt;&amp;lt;task-flow-definition id="ToChildSFFlow"&amp;gt;&lt;br /&gt;   &amp;lt;default-activity&amp;gt;TochildSFPF&amp;lt;/default-activity&amp;gt;&lt;br /&gt;   &amp;lt;input-parameter-definition&amp;gt;&lt;br /&gt;     &amp;lt;name&amp;gt;Empno&amp;lt;/name&amp;gt;&lt;br /&gt;     &amp;lt;value&amp;gt;#{pageFlowScope.Empno}&amp;lt;/value&amp;gt;&lt;br /&gt;     &amp;lt;class&amp;gt;java.lang.String&amp;lt;/class&amp;gt;&lt;br /&gt;   &amp;lt;/input-parameter-definition&amp;gt;&lt;br /&gt;   ...&lt;br /&gt;&amp;lt;/task-flow-definition&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/task-flow-definition&gt;&lt;/pre&gt; &lt;/div&gt; &lt;p&gt;Note that the name of the input parameter (i.e., "&lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt;")  needs to be the same as the parameter name defined on the &lt;span style="font-family:Courier;"&gt;task flow call activity&lt;/span&gt;. When parameter is available, ADF will place it in:&lt;/p&gt; &lt;div&gt;&lt;code&gt;#{pageFlowScope.Empno}&lt;/code&gt; &lt;/div&gt; &lt;p&gt;to be used within sub-flow. However, this &lt;span style="font-family:Courier;"&gt;pageFlowScope&lt;/span&gt; is different from the one defined in the &lt;span style="font-family:Courier;"&gt;Task Flow Call&lt;/span&gt; activity because they have different owning task flow (i.e., parent task flow vs. sub-flow).&lt;/p&gt; &lt;div&gt;Here is the definition of sub-flow:&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;a href="http://4.bp.blogspot.com/-Yy2qmDmeBFI/TrXIqs8mODI/AAAAAAAAAoU/AUDZW9uskpU/s1600/sub-flow2.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 315px;" src="http://4.bp.blogspot.com/-Yy2qmDmeBFI/TrXIqs8mODI/AAAAAAAAAoU/AUDZW9uskpU/s400/sub-flow2.png" alt="" id="BLOGGER_PHOTO_ID_5671659941688391730" border="0" /&gt;&lt;/a&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;In the sample implementation, we chose to implement the initialization step in the sub-flow. &lt;span style="font-family:Courier;"&gt;Empno&lt;/span&gt;  is passed as an parameter to sub-flow and used to initialize parent  state. When sub-flow is launched, default view activity (i.e., &lt;span style="font-family:Courier;"&gt;ToChildPF&lt;/span&gt;) displays. Before it renders, &lt;span style="font-family:Courier;"&gt;initPage&lt;/span&gt; method on the &lt;span style="font-family:Courier;"&gt;ChildBean&lt;/span&gt; will be executed first. The page definition of the default page is defined as follows:&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;pre class="code-java"&gt;&lt;pagedefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"&gt;&amp;lt;pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"&amp;gt;&lt;br /&gt; &amp;lt;parameters/&amp;gt;&lt;br /&gt; &amp;lt;executables&amp;gt;&lt;br /&gt;   ...&lt;br /&gt;   &amp;lt;invokeAction id="initPageId" Binds="initPage" Refresh="always"/&amp;gt;&lt;br /&gt; &amp;lt;/executables&amp;gt;&lt;br /&gt; &amp;lt;bindings&amp;gt;&lt;br /&gt;   ...&lt;br /&gt;   &amp;lt;methodAction id="initPage" InstanceName="ChildSFBean.dataProvider"&lt;br /&gt;                 DataControl="ChildSFBean" RequiresUpdateModel="true"&lt;br /&gt;                 Action="invokeMethod" MethodName="initPage"&lt;br /&gt;                 IsViewObjectMethod="false"&lt;br /&gt;                 ReturnName="ChildSFBean.methodResults.initPage_ChildSFBean_dataProvider_initPage_result"/&amp;gt;&lt;br /&gt;    ...&lt;br /&gt; &amp;lt;/bindings&amp;gt;&lt;br /&gt;&amp;lt;/pageDefinition&amp;gt;&lt;br /&gt;&lt;parameters&gt;&lt;executables&gt;&lt;bindings&gt;&lt;methodaction id="&amp;lt;font " style=""&gt;&lt;br /&gt;&lt;/methodaction&gt;&lt;/bindings&gt;&lt;/executables&gt;&lt;/parameters&gt;&lt;/pagedefinition&gt;&lt;/pre&gt;As shown above, &lt;span style="font-family:Courier;"&gt;initPage&lt;/span&gt; is specified in the &lt;span style="font-style: italic;"&gt;executables &lt;/span&gt;tag and will be invoked when the page is refreshed. &lt;span style="font-family:Courier;"&gt;initPage&lt;/span&gt; method itself is defined as follows:&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div&gt;&lt;pre class="oac_no_warn"&gt;public void initPage()&lt;br /&gt;{&lt;br /&gt;   FacesContext facesContext = FacesContext.getCurrentInstance();&lt;br /&gt;   ExpressionFactory exp = facesContext.getApplication().getExpressionFactory();&lt;br /&gt;   DCBindingContainer bindingContainer =&lt;br /&gt;     (DCBindingContainer)exp.createValueExpression(&lt;br /&gt;         facesContext.getELContext(),"#{bindings}",DCBindingContainer.class).getValue(facesContext.getELContext());&lt;br /&gt;   ApplicationModule am = bindingContainer.getDataControl().getApplicationModule();&lt;br /&gt;&lt;br /&gt;   ViewObject vo = am.findViewObject("ComplexSFEmpVO");&lt;br /&gt;   vo.executeQuery();&lt;br /&gt;&lt;br /&gt;   Map map = AdfFacesContext.getCurrentInstance().getPageFlowScope();&lt;br /&gt;   if(map !=null){&lt;br /&gt;        Object empObj = map.get("Empno");&lt;br /&gt;        if(empObj instanceof Integer){&lt;br /&gt;            Integer empno =(Integer)map.get("Empno");// new Integer(empnoStr);&lt;br /&gt;            Object[] obj = {empno};&lt;br /&gt;            Key key = new Key(obj);&lt;br /&gt;            Row row = vo.getRow(key);&lt;br /&gt;            vo.setCurrentRow(row);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            String empnoStr = (String)map.get("Empno");&lt;br /&gt;            Integer empno = new Integer(empnoStr);&lt;br /&gt;            Object[] obj = {empno};&lt;br /&gt;            Key key = new Key(obj);&lt;br /&gt;            Row row = vo.getRow(key);&lt;br /&gt;            vo.setCurrentRow(row);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;code&gt;&lt;/code&gt;&lt;/div&gt; &lt;p&gt;In &lt;span style="font-style: italic;"&gt;initPage&lt;/span&gt;, it takes input parameter &lt;span style="font-style: italic;"&gt;Empno &lt;/span&gt;(i.e.,  from #{pageFlowScope.Empno}) as a key to select a row and set it to be  the current row in the master table (i.e., Employee table).&lt;/p&gt;&lt;p&gt;References&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E15586_01/fusionapps.1111/e15524/toc.htm"&gt;Oracle® Fusion Applications Developer's Guide 11g Release 1 (11.1.1.5) &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/05/opensubtask-and-closesubtask-apis.html"&gt;openSubTask and closeSubTask APIs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/03/oracle-adf-task-flow-in-nutshell.html"&gt;Oracle ADF Task Flow in a Nutshell&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-2020998272670266225?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/vVHbIrRjZAY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/2020998272670266225/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=2020998272670266225" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2020998272670266225?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2020998272670266225?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/vVHbIrRjZAY/sub-flow-design-pattern.html" title="Sub-flow Design Pattern" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-IDbtkHUvPUw/TrXKJ4P8FbI/AAAAAAAAAog/qkdinbJpOaU/s72-c/sub-flow3.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/11/sub-flow-design-pattern.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcCQ34-cCp7ImA9WhRQFEQ.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-7090084535291417601</id><published>2011-09-22T08:54:00.001-07:00</published><updated>2011-12-09T22:04:22.058-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-09T22:04:22.058-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WebCenter Framework" /><category scheme="http://www.blogger.com/atom/ns#" term="WebCenter Services" /><category scheme="http://www.blogger.com/atom/ns#" term="WebCenter" /><category scheme="http://www.blogger.com/atom/ns#" term="Portal and Portlet" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle WebCenter 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="WebCenter Spaces" /><title>Book Review: "Oracle WebCenter 11g PS3 Administration Cookbook"</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5jJle_Q8sqlFTfkpARW_RQvA8vA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5jJle_Q8sqlFTfkpARW_RQvA8vA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5jJle_Q8sqlFTfkpARW_RQvA8vA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5jJle_Q8sqlFTfkpARW_RQvA8vA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-nvZA9_0UtT0/Tntabka0M4I/AAAAAAAAAn4/z1_6AfSoXnA/s1600/BookReview.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 308px; height: 400px;" src="http://4.bp.blogspot.com/-nvZA9_0UtT0/Tntabka0M4I/AAAAAAAAAn4/z1_6AfSoXnA/s400/BookReview.jpg" alt="" id="BLOGGER_PHOTO_ID_5655213186772906882" border="0" /&gt;&lt;/a&gt;There are three  major components in the WebCenter product stack:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;WebCenter Framework&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Allows you to embed portlets, &lt;a href="http://xmlandmore.blogspot.com/2010/03/oracle-adf-task-flow-in-nutshell.html"&gt;ADF Taskflows&lt;/a&gt;, content, and customizable components to create your WebCenter Portal application&lt;/li&gt;&lt;li&gt;All Framework pieces are integrated into the Oracle JDeveloper IDE, providing access to these resources as you build your applications&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;WebCenter Services&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Are a set of independently deployable collaboration services&lt;/li&gt;&lt;li&gt; Incorporates Web 2.0 components such as content, collaboration, discussion, announcement and communication services&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;WebCenter Spaces&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Is an out-of-the-box WebCenter Portal application for team collaboration and enterprise social networking&lt;/li&gt;&lt;li&gt; &lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:14pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Is built using the WebCenter Framework, WebCenter services, and Oracle Composer&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:14pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;As the strategic portal product of Oracle, WebCenter Framework plays in the &lt;a href="http://en.wikipedia.org/wiki/Enterprise_portal" title="Enterprise portal"&gt;Enterprise portal&lt;/a&gt; space, and WebCenter Services/Spaces plays in the Collaboration Workspace space.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What's Portal Application?&lt;/h3&gt;&lt;br /&gt;A portal can be thought of as an aggregator of content and applications  or a single point of entry to a user's set of tools and applications.  It is a web-based application that is customizable by the end-user both in the  look and feel of the portal and in the available content and  applications which the portal contains.&lt;br /&gt;&lt;br /&gt;The key elements of portals include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Page hierarchy&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Navigation&lt;/li&gt;&lt;li&gt;Delegated administration and other security  features&lt;/li&gt;&lt;li&gt;Runtime customization and personalization.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;To design a successful enterprise web portal is hard, but getting easier and more practical with Oracle WebCenter which is built on top of Oracle ADF technology.  As an enterprise portal, security is extremely important.  Unauthorized people should never get access, and different groups may have different permissions. Customers, partners and employees should be able to use a single login to access all relevant information and applications.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The Book&lt;/h3&gt;&lt;br /&gt;To design, test, deploy, and maintain a successful web portal is nontrivial to say the least.  Therefore, a cookbook like &lt;span style="font-size:100%;"&gt;&lt;a href="http://link.packtpub.com/ozliUs"&gt;Oracle WebCenter 11g PS3 Administration Cookbook&lt;/a&gt; is needed.  &lt;/span&gt;In fourteen chapters, it provides over a hundred step-by-step recipes that help the  reader through a wide variety of tasks ranging from portal and portlet  creation to securing, supporting, managing, and administering Oracle WebCenter.&lt;br /&gt;&lt;br /&gt;In the book, it covers many new features introduced by the 11g R1 Patch Set 3 version of the Oracle WebCenter product.  It also touches upon all three components: &lt;span style="font-style: italic;"&gt;WebCenter Framework&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;WebCenter Services&lt;/span&gt;, and &lt;span style="font-style: italic;"&gt;WebCenter Spaces &lt;/span&gt;and roughly in that order.  Besides important topics such as customization and security , it also discuss the analytics aspect of the product (i.e., &lt;span style="font-style: italic;"&gt;Activity Graph&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Resource Catalog&lt;/h3&gt;Using resource catalog as an example, in this book, you'll learn that:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; How to create a resource catalog either at design time or runtime&lt;/li&gt;&lt;li&gt; How to specify a catalog filter or a catalog selector&lt;br /&gt;&lt;/li&gt;&lt;li&gt; How to add a link to the resource catalog&lt;/li&gt;&lt;li&gt; How to add an existing resource catalog to the catalog&lt;/li&gt;&lt;li&gt; How to add custom components to a resource catalog&lt;/li&gt;&lt;li&gt; &lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:19px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;How to add custom folder to the resource catalog&lt;/li&gt;&lt;/ul&gt;At each step, you'll learn how it works and why.  For example, when you add a resource catalog at runtime, an XML file will also be created, but it will be stored in the MDS (Metadata Service Repository) which is a repository used by WebCenter to store metadata.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Trade-offs&lt;/h3&gt;&lt;br /&gt;After the introduction of different approaches, the author also discusses the trade-offs of each approach.  For example, with &lt;span style="font-style: italic;"&gt;WebCenter Spaces&lt;/span&gt;, it allows you to build collaborative intranets  without needing to develop a lot. The problem you will be having with &lt;span style="font-style: italic;"&gt; WebCenter Spaces &lt;/span&gt;is that it is not as easily customizable as a regular &lt;span style="font-style: italic;"&gt; WebCenter Portal &lt;/span&gt;application. Therefore, you can combine the best of  both worlds. When you need a high level of customization or you need to  extend the site with your custom functionality, then you should create a &lt;span style="font-style: italic;"&gt; WebCenter Portal&lt;/span&gt; application. When you need a collaborative environment  where customization or added functionality is not as important as the  collaborative services, then go for &lt;span style="font-style: italic;"&gt;WebCenter Spaces&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;References&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/07/book-review-of-oracle-warehouse-builder.html"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://link.packtpub.com/ozliUs"&gt;Oracle WebCenter 11g PS3 Administration Cookbook&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.backbase.com/rich-portal/Whitepaper-Creating-a-Successful-Web-Portal.pdf"&gt;Creating a Successful Web Portal&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Oracle_WebCenter"&gt;Oralce WebCenter (Wikipedia)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/03/oracle-adf-task-flow-in-nutshell.html"&gt;Oracle ADF Task Flow in a Nutshell&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/11/book-review-of-web-20-solutions-with.html"&gt;Book Review: Web 2.0 Solutions with Oracle WebCenter 11g&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-7090084535291417601?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/337-iRN2H3A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/7090084535291417601/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=7090084535291417601" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/7090084535291417601?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/7090084535291417601?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/337-iRN2H3A/book-review-oracle-webcenter-11g-ps3.html" title="Book Review: &quot;Oracle WebCenter 11g PS3 Administration Cookbook&quot;" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-nvZA9_0UtT0/Tntabka0M4I/AAAAAAAAAn4/z1_6AfSoXnA/s72-c/BookReview.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/09/book-review-oracle-webcenter-11g-ps3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQAQXwzfip7ImA9WhRQGUo.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-9144460335510548588</id><published>2011-09-17T13:24:00.000-07:00</published><updated>2011-12-15T11:45:40.286-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-15T11:45:40.286-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="getViewCriteria" /><category scheme="http://www.blogger.com/atom/ns#" term="View Criteria" /><category scheme="http://www.blogger.com/atom/ns#" term="Filtering Data" /><category scheme="http://www.blogger.com/atom/ns#" term="createViewCriteria" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle ADF 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="createPreparedStatement" /><title>ADF View Criteria By Example</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IKLoBaWlnEzNPUwlbLyKoUcdPYM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IKLoBaWlnEzNPUwlbLyKoUcdPYM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IKLoBaWlnEzNPUwlbLyKoUcdPYM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IKLoBaWlnEzNPUwlbLyKoUcdPYM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;There are different filtering approaches to query row data provided in &lt;a href="http://www.oracle.com/technetwork/developer-tools/adf/overview/index.html"&gt;Oracle ADF 11g&lt;/a&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;By adding WHERE clause to View Object SQL statement&lt;/li&gt;&lt;li&gt;By creating View Criteria Programmatically&lt;/li&gt;&lt;li&gt;By using named View Criteria&lt;/li&gt;&lt;/ul&gt;In this article, we will examine these different approaches followed by the discussion of view criteria.&lt;br /&gt;&lt;br /&gt;Not that all three examples shown in the article are defined in the &lt;a href="http://xmlandmore.blogspot.com/2011/06/reusable-adf-componentsapplication.html"&gt;application module&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Adding WHERE Clause&lt;/h3&gt;In the first example (i.e., &lt;span style="font-family: courier new;"&gt;getChannel1&lt;/span&gt;), it gets the query statement from the View Object and appends it with a WHERE clause.  Then the &lt;span style="font-family: courier new;"&gt;PreparedStatement &lt;/span&gt;is executed with specified filtering.&lt;br /&gt;&lt;pre&gt;public OracleCachedRowSet getChannel1(Long channelId)&lt;br /&gt;throws SQLException&lt;br /&gt;{&lt;br /&gt;ResultSet rs = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;ViewObjectImpl vo =&lt;br /&gt;(ViewObjectImpl) this.findViewObject("ChannelOnly");&lt;br /&gt;StringBuffer query = new StringBuffer(vo.getQuery());&lt;br /&gt;query.append(" where ChannelEO.CHANNEL_ID =").append(channelId);&lt;br /&gt;DBTransaction txn = this.getDBTransaction();&lt;br /&gt;PreparedStatement ps =&lt;br /&gt;txn.createPreparedStatement(query.toString(), 1);&lt;br /&gt;rs = ps.executeQuery();&lt;br /&gt;OracleCachedRowSet ocs = new OracleCachedRowSet();&lt;br /&gt;ocs.populate(rs);&lt;br /&gt;&lt;br /&gt;return ocs;&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;if (AppsLogger.isEnabled(AppsLogger.SEVERE))&lt;br /&gt;{&lt;br /&gt;AppsLogger.write(OsmmSetupUiModelAMImpl.class, e);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if (rs != null)&lt;br /&gt;rs.close();&lt;br /&gt;}&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;Creating View Criteria Programmatically&lt;/h3&gt;In the second example (i.e., &lt;span style="font-style: italic;"&gt;getChannel2&lt;/span&gt;), it shows that a &lt;span style="font-style: italic;"&gt;ViewCriteria &lt;/span&gt;object is created at runtime by using &lt;span style="font-style: italic;"&gt;ViewCriteriaRow's&lt;/span&gt;, which in turn are composed of &lt;span style="font-style: italic;"&gt;ViewCritiaItem's&lt;/span&gt;.  Then this &lt;span style="font-style: italic;"&gt;ViewCriteria &lt;/span&gt;object is applied to the &lt;span style="font-style: italic;"&gt;View Object &lt;/span&gt;and used in the filtering.&lt;br /&gt;&lt;pre&gt; public  void getChannel2(Long channelId)&lt;br /&gt;{&lt;br /&gt;// Create and populate criteria rows to support query-by-example.&lt;br /&gt;ViewObject channelVO = this.findViewObject("ChannelOnly");&lt;br /&gt;ViewCriteria vc = channelVO.createViewCriteria();&lt;br /&gt;ViewCriteriaRow vcRow = vc.createViewCriteriaRow();&lt;br /&gt;&lt;br /&gt;// ViewCriteriaRow attribute name is case-sensitive.&lt;br /&gt;// ViewCriteriaRow attribute value requires operator and value.&lt;br /&gt;// Note also single-quotes around string value.&lt;br /&gt;ViewCriteriaItem jobItem = vcRow.ensureCriteriaItem("ChannelId");&lt;br /&gt;jobItem.setOperator("=");&lt;br /&gt;jobItem.getValues().get(0).setValue(channelId);&lt;br /&gt;vc.add(vcRow);&lt;br /&gt;&lt;br /&gt;channelVO.applyViewCriteria(vc);&lt;br /&gt;&lt;br /&gt;// Multiple rows are OR-ed in WHERE clause.&lt;br /&gt;System.out.println("Demo View Criteria");&lt;br /&gt;&lt;br /&gt;// Should print channel with specified channel ID&lt;br /&gt;printViewObject(channelVO);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public  void printViewObject(ViewObject vo)&lt;br /&gt;{&lt;br /&gt;// Execute the query, print results to the screen.&lt;br /&gt;vo.executeQuery();&lt;br /&gt;&lt;br /&gt;// Print the View Object's query&lt;br /&gt;System.out.println("Query: " + vo.getQuery());&lt;br /&gt;&lt;br /&gt;while (vo.hasNext())&lt;br /&gt;{&lt;br /&gt;Row row = vo.next();&lt;br /&gt;String rowDataStr = "";&lt;br /&gt;&lt;br /&gt;// How many attributes (columns) is the View Object using?&lt;br /&gt;int numAttrs = vo.getAttributeCount();&lt;br /&gt;&lt;br /&gt;// Column numbers start with 0, not 1.&lt;br /&gt;for (int columnNo = 0; columnNo &amp;lt; numAttrs; columnNo++)&lt;br /&gt;{    &lt;br /&gt;// See also Row.getAttribute(String name).    &lt;br /&gt;Object attrData = row.getAttribute(columnNo);&lt;br /&gt;rowDataStr += (attrData + "\t");&lt;br /&gt;}&lt;br /&gt;System.out.println(rowDataStr);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;Using Named View Criteria&lt;/h3&gt;In the third example (i.e., &lt;span style="font-style: italic;"&gt;getChannel3&lt;/span&gt;), it finds a named View Criteria (i.e., &lt;span style="font-style: italic;"&gt;findByChannelId&lt;/span&gt;) which is defined at design time.  After setting the value of named Bind Variable (i.e., &lt;span style="font-style: italic;"&gt;ChannelIdBV&lt;/span&gt;), the view criteria is applied to the &lt;span style="font-style: italic;"&gt;View Object &lt;/span&gt;and used in querying the row data.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;public Row[] getChannel3(Long channelId)&lt;br /&gt;{&lt;br /&gt;ChannelVOImpl viewObj = (ChannelVOImpl) this.getChannelOnly();&lt;br /&gt;if (viewObj != null)&lt;br /&gt;{&lt;br /&gt;ViewCriteria vc = viewObj.getViewCriteria("findByChannelId");&lt;br /&gt;viewObj.setNamedWhereClauseParam("ChannelIdBV", channelId);&lt;br /&gt;viewObj.applyViewCriteria(vc);&lt;br /&gt;viewObj.executeQuery();&lt;br /&gt;viewObj.setRangeSize(-1);&lt;br /&gt;Row[] allRows = viewObj.getAllRowsInRange();&lt;br /&gt;return allRows;&lt;br /&gt;}&lt;br /&gt;return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;What's View Criteria&lt;/h3&gt; &lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;Before the advent of Oracle ADF 11g, to show an employee list filtered by company role on one page and by department number on another page, you would have needed to either create separate view objects for each page or write custom code to selectively modify a view object's WHERE clause and bind variable values. With the new release, you can now use a single view object with multiple named view criteria filters to accomplish the same task.&lt;br /&gt;&lt;br /&gt;A view criteria you define lets you specify filter information for the rows of a view object collection.  The view criteria object is a row set of one or more view criteria rows, whose attributes mirror those in the view object. The view criteria definition comprises query conditions that augment the WHERE clause of the target view object. Query conditions that you specify apply to the individual attributes of the target view object.  Check out &lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#BCGIFHHF"&gt;here &lt;/a&gt;for:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;How to Create Named View Criteria Declaratively&lt;/li&gt;&lt;li&gt;How to Test View Criteria Using the Business Component Browser&lt;/li&gt;&lt;li&gt;How to Create View Criteria Programmatically&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;Advantages of Using Named View Criteria&lt;/h3&gt;Among the different approaches, the third one is the preferred approach.  This is because view criteria that you define at design time can participate in these scenarios where filtering results is desired at runtime:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Supporting Query-by-Example search forms that allow the end user to supply values for attributes of the target view object&lt;sup&gt;[2]&lt;/sup&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Filtering the list of values (LOV) components that allow the end user may select from one attribute list (displayed in the UI as an LOV component)&lt;sup&gt;[3]&lt;/sup&gt;.&lt;/li&gt;&lt;li&gt;Validating attribute values using a view accessor with a view criteria applied to filter the view accessor results&lt;sup&gt;[4]&lt;/sup&gt;.&lt;/li&gt;&lt;li&gt;Creating the application module's data model from a single view object definition with a unique view criteria applied for each view instance&lt;sup&gt;[5]&lt;/sup&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h3&gt;References&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#BCGIFHHF"&gt;Working with Named View Criteria&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/web_search_bc.htm#CIHIJFCH"&gt;Creating Query Search Forms&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/lists.htm#CEGFJFED"&gt;Creating a Selection List&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bclookups.htm#BABCIBJA"&gt;How to Validate Against a View Accessor&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bclookups.htm#BABIBHIJ"&gt;How to Define the WHERE Clause of the Lookup View Object Using View Criteria&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/06/reusable-adf-componentsapplication.html"&gt;Reusable ADF Components—Application Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/developer-tools/adf/overview/index.html"&gt;Oracle Application Development Framework&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-9144460335510548588?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/rdU4_ddg_Kw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/9144460335510548588/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=9144460335510548588" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/9144460335510548588?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/9144460335510548588?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/rdU4_ddg_Kw/adf-view-criteria-in-depth.html" title="ADF View Criteria By Example" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/09/adf-view-criteria-in-depth.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIGRHk9eSp7ImA9WhdXFUg.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-5728902743900571614</id><published>2011-08-14T19:05:00.000-07:00</published><updated>2011-08-28T10:28:45.761-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-28T10:28:45.761-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Book View" /><category scheme="http://www.blogger.com/atom/ns#" term="Business Management Service" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Enterprise Manager" /><category scheme="http://www.blogger.com/atom/ns#" term="OEM Grid Control" /><title>Book Review: "Overview of Oracle Enterprise Manager Grid Control 11g R1: Business Service Management"</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Lr7nhGY59KI_ltV4ztriDS2QW2A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lr7nhGY59KI_ltV4ztriDS2QW2A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Lr7nhGY59KI_ltV4ztriDS2QW2A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Lr7nhGY59KI_ltV4ztriDS2QW2A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-CRYyZh7PPcE/TjRMNMRUSZI/AAAAAAAAAnQ/TRHlwjbRR_M/s1600/OEMBookReview.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 342px; height: 400px;" src="http://3.bp.blogspot.com/-CRYyZh7PPcE/TjRMNMRUSZI/AAAAAAAAAnQ/TRHlwjbRR_M/s400/OEMBookReview.JPG" alt="" id="BLOGGER_PHOTO_ID_5635212823263201682" border="0" /&gt;&lt;/a&gt;There are different console applications or flavors provided in Oracle Enterprise Manager (OEM):
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;OEM Database Control&lt;/li&gt;&lt;li&gt;OEM Application Server and Fusion Middleware Control&lt;/li&gt;&lt;li&gt;OEM Grid Control&lt;/li&gt;&lt;/ul&gt;&lt;a href="http://3.bp.blogspot.com/-u2Xs5D0jZnA/TlFiudz-L0I/AAAAAAAAAno/3IvQYtlJVpg/s1600/OEMFlavors.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 252px;" src="http://3.bp.blogspot.com/-u2Xs5D0jZnA/TlFiudz-L0I/AAAAAAAAAno/3IvQYtlJVpg/s400/OEMFlavors.jpg" alt="" id="BLOGGER_PHOTO_ID_5643400358488059714" border="0" /&gt;&lt;/a&gt;The &lt;a href="http://en.wikipedia.org/wiki/Business_service_management"&gt;Business Service Management &lt;/a&gt;(BSM) capabilities of Oracle Enterprise Manager are available only in the &lt;span style="font-style: italic;"&gt;Grid Control &lt;/span&gt;flavor.
&lt;br /&gt;
&lt;br /&gt;In this book "&lt;a href="http://link.packtpub.com/Frb3ot"&gt;Overview of Oracle Enterprise Manager Grid Control 11g R1: Business Service Management&lt;/a&gt;", it covers OEM's Business Service Management capabilities in great details as described in this article.
&lt;br /&gt;
&lt;br /&gt;&lt;h3&gt;Business Service Management&lt;/h3&gt;Business Service Management (BSM) is a methodology for monitoring and  measuring Information Technology (IT) services from a &lt;span style="font-weight: bold;"&gt;business  perspective&lt;/span&gt;.  It allows IT departments to operate by service rather than by  individual manageable entity or &lt;span style="font-weight: bold;"&gt;target&lt;/span&gt;.
&lt;br /&gt;
&lt;br /&gt;BSM software and services are provided by major vendors.  Oracle Enterprise Manager (OEM) 11g is a product offering from Oracle that provides solutions to the typical IT infrastructure management issues.&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;h3&gt;Management Issues&lt;/h3&gt;Any enterprise IT infrastructure contains numerous disparate components that are geographically distributed across various data centers. These components include:&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Hardware components&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Such as servers hosting different applications, network switches, routers, storage devices, and so on&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Software components&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Such  as operating systems, database servers, application servers, middleware  components, packaged applications, distributed applications, and so on&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;To make things even worse, an IT infrastructure also have the following characteristics:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Hardware and software could be sourced from multiple vendors&lt;/li&gt;&lt;li&gt;Multiple versions of the same software product, from the same vendor, could be deployed across the enterprise&lt;/li&gt;&lt;li&gt; Newer technologies such as service-oriented architectures (SOA), virtualization, cloud computing, portal frameworks, grid architectures, and mashups within an organizations make troubleshooting and monitoring of business services very difficult &lt;/li&gt;&lt;/ul&gt;These heterogeneous, disparate and geographically distributed components give rise to the complexity of IT management issues.&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;h3&gt;The Needs&lt;/h3&gt;Facing these challenges, a successful management solution must:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Have the capability to model, monitor, administer, and configure higher-level logical entities that map to business functions&lt;/li&gt;&lt;li&gt;Provide  different perspectives to get a comprehensive view of the  health of the various business services and the underlying IT  infrastructure&lt;/li&gt;&lt;li&gt;Be able to perform complex computations and scale very easily with a simple architecture and a small footprint&lt;/li&gt;&lt;li&gt; Take into consideration the geographical spread of the infrastructure landscape&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;h3&gt;The Solution&lt;/h3&gt; &lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;Oracle Enterprise Manager (OEM) is one of the industry leaders in the system management products arena.  It provides the following capabilities:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A single unified platform for modeling and managing enterprise data centers&lt;/li&gt;&lt;li&gt; Comprehensive monitoring and management capabilities for the entire Oracle Grid within the enterprise&lt;/li&gt;&lt;li&gt; Discovery, monitoring, and management of various pieces of the IT infrastructure&lt;ul&gt;&lt;li&gt; Includes Non-Oracle Software Products &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; Supports both passive and active monitoring paradigms&lt;/li&gt;&lt;li&gt;Two distinct perspectives:&lt;ul&gt;&lt;li&gt;Target-based focus&lt;ul&gt;&lt;li&gt; This provides a highly specialized set of views exclusive for a specific target &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Business service-based focus&lt;ul&gt;&lt;li&gt; This provides a holistic view that dwells on different targets within an enterprise and their interactions with each other to achieve a business objective &lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt; Capabilities of defining and tracking  Service-Level Agreements (SLAs) of different business functions &lt;/li&gt;&lt;/ul&gt; &lt;a href="http://2.bp.blogspot.com/-R2b51bgE89A/TlGBcAoKsxI/AAAAAAAAAnw/Au5gLGx9xB4/s1600/OEMArchitecture.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 297px;" src="http://2.bp.blogspot.com/-R2b51bgE89A/TlGBcAoKsxI/AAAAAAAAAnw/Au5gLGx9xB4/s400/OEMArchitecture.png" alt="" id="BLOGGER_PHOTO_ID_5643434126276735762" border="0" /&gt;&lt;/a&gt;The &lt;span style="font-style: italic;"&gt;Grid Control &lt;/span&gt;architecture (see the Figure above) is distributed in nature and relies on the agents to collect data on the individual hosts.  It includes the following components:&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Oracle Management Agent&lt;ul&gt;&lt;li&gt;A piece of software installed on a host that collects information about the targets on the host or remote hosts.  The collected data is then passed onto the management service.&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;In case of remote monitoring (vs. local monitoring), there is no automatic discovery support and the administrator must use the console UI pages to initiate the remote discovery. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;Oracle Management Service (OMS)&lt;ul&gt;&lt;li&gt;This is the brain of the OEM.  It acts as the centralized management solution and also acts as the server to which all the management agents upload the collected data.&lt;/li&gt;&lt;li&gt;The OMS provides current and future insights into business functions and services by looking at the historical data that is stored in its management repository.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;OEM Console&lt;/li&gt;&lt;li style="list-style-type: none; display: inline;"&gt;&lt;ul&gt;&lt;li&gt;This is the user interface that exposes all the management functionalities to the end user of OEM.&lt;/li&gt;&lt;li&gt;It provides views into each of the targets and also allows the user to initiate actions and configuration changes on these targets.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Oracle Management Repository &lt;ul&gt;&lt;li&gt;This is the central repository that is used by the OMS to store all data.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;By distributing the data collection to individual agents the &lt;span style="font-style: italic;"&gt;Oracle Management Service &lt;/span&gt;(OMS) is freed up to perform more important tasks.&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;h3&gt;The Book&lt;/h3&gt;In the book, it has used a travel portal as example to:&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Illustrate the concepts of IT infrastructure management&lt;/li&gt;&lt;li&gt;Showcase OEM's BSM capabilities&lt;/li&gt;&lt;li&gt;Provide step-by-step instructions of using OEM&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;
&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; The travel portal provides various business services such as flight search, car rental services, and so on to the end users. It also consumes the payment gateway services from various business partners.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style=";font-family:Book Antiqua;font-size:85%;"  &gt;&lt;span style="font-size:10pt;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;In the travel portal illustration, these services are configured as different service targets such as:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;CarRentalService: &lt;ul&gt;&lt;li&gt;Modeled as a Generic Service target based on the TravelPortal-CarRental-System&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;FlightSearchWebSite: &lt;ul&gt;&lt;li&gt;Modeled as a Web Application service based on a Service Test from two different beacons&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;PaymentGatewayService: &lt;ul&gt;&lt;li&gt;Modeled as a Forms Application based on the PaymentGatewaySystem&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;TravelPortalSearchServices: &lt;ul&gt;&lt;li&gt;Modeled as an Aggregate Service comprising the CarRentalService and FlightSearchWebSite service targets&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Resources&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://link.packtpub.com/Frb3ot"&gt;Overview of Oracle Enterprise Manager Grid Control 11g R1: Business Service Management&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/us/technologies/grid/products-066446.html"&gt;Oracle Grid Products&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/us/products/tools/oracle-grid-engine-075549.html"&gt;Oracle Grid Engine&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/us/products/enterprise-manager/index.html"&gt;Oracle Enterprise Manager&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/oem/grid-control/overview/index.html"&gt;Enterprise Manager Grid Control&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-5728902743900571614?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/zx2trTWdFlI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/5728902743900571614/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=5728902743900571614" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/5728902743900571614?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/5728902743900571614?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/zx2trTWdFlI/book-reriew-of-overview-of-oracle.html" title="Book Review: &quot;Overview of Oracle Enterprise Manager Grid Control 11g R1: Business Service Management&quot;" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-CRYyZh7PPcE/TjRMNMRUSZI/AAAAAAAAAnQ/TRHlwjbRR_M/s72-c/OEMBookReview.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/08/book-reriew-of-overview-of-oracle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQDR3s4eCp7ImA9WhdSF0Q.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-7738116503305711878</id><published>2011-07-26T13:19:00.000-07:00</published><updated>2011-07-27T12:19:36.530-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-27T12:19:36.530-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Offline Database" /><category scheme="http://www.blogger.com/atom/ns#" term="Column Comment" /><category scheme="http://www.blogger.com/atom/ns#" term="Table Comment" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Excel" /><category scheme="http://www.blogger.com/atom/ns#" term="JDeveloper 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="Data Model Design" /><title>Beautifying Table and Column Comments for Design Review</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rUiu5jbp84JbuM5SQD1H6qxg0cQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rUiu5jbp84JbuM5SQD1H6qxg0cQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rUiu5jbp84JbuM5SQD1H6qxg0cQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rUiu5jbp84JbuM5SQD1H6qxg0cQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Data model design is an iterative process.  As soon as the conceptual data model is accepted by the functional team, development of logical data model gets started.  Once logical data model is completed, it is then forwarded to functional teams for review.  A good data model is created by clearly thinking about the current and future business requirements.&lt;br /&gt;&lt;br /&gt;To facilitate the review process, you need to present descriptions of entities and attributes in the data model to the functional team.  Some database developers prefer working at source level (i.e., SQL DDL).  For example, you can present the following &lt;span style="font-style: italic;"&gt;EMP &lt;/span&gt;table to the team for review:&lt;br /&gt;&lt;pre&gt;-- Employee Data&lt;br /&gt;CREATE TABLE "SCOTT"."EMP"&lt;br /&gt;(&lt;br /&gt;"EMPNO" NUMBER(4,0),        -- employee number&lt;br /&gt;"ENAME" VARCHAR2(10 BYTE),  -- employee name&lt;br /&gt;"JOB"   VARCHAR2(9 BYTE),   -- job description&lt;br /&gt;"MGR"   NUMBER(4,0),        -- manager ID&lt;br /&gt;"HIREDATE" DATE,            -- hiring date&lt;br /&gt;"SAL"    NUMBER(7,2),       -- salary&lt;br /&gt;"COMM"   NUMBER(7,2),       -- commission&lt;br /&gt;"DEPTNO" NUMBER(2,0),       -- department number&lt;br /&gt;CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE,&lt;br /&gt;CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;In this article, we will show another way which presents the following table generated semi-automatically from the offline database using &lt;span style="font-style: italic;"&gt;JDeveloper &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;Microsoft Excel&lt;/span&gt;:&lt;br /&gt;&lt;pre&gt;&lt;a href="http://2.bp.blogspot.com/-e9dylqBHbH4/Ti9PC8MBXCI/AAAAAAAAAm0/_BCJJUNSC9s/s1600/CommentTable.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 317px; height: 310px;" src="http://2.bp.blogspot.com/-e9dylqBHbH4/Ti9PC8MBXCI/AAAAAAAAAm0/_BCJJUNSC9s/s400/CommentTable.JPG" alt="" id="BLOGGER_PHOTO_ID_5633808570798660642" border="0" /&gt;&lt;/a&gt;&lt;/pre&gt;Using the first approach, the drawbacks include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SQL DDL scripts tend to be error-prone&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Comments are only for human reader and not part of the DB definitions&lt;/li&gt;&lt;/ul&gt;That's why we propose the second approach which can resolve these two issues.&lt;br /&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Offline Database&lt;/h3&gt;In &lt;span style="font-style: italic;"&gt;JDeveloper&lt;/span&gt;, database development is available offline in the context of a project, allowing developers to create and manipulate schemas of database objects which can be generated to a database or to SQL scripts.  Database objects can also be imported from a database into a project.  See my previous &lt;a href="http://xmlandmore.blogspot.com/2011/07/modeling-data-with-offline-database-in.html"&gt;post &lt;/a&gt;for more details.&lt;br /&gt;&lt;br /&gt;You can follow the instructions in [&lt;a href="http://download.oracle.com/docs/cd/E18941_01/tutorials/jdtut_11r2_84/jdtut_11r2_84.html"&gt;1&lt;/a&gt;, &lt;a href="http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/database%20development/obe_%20dbasedevmt.htm#t3s3"&gt;2&lt;/a&gt;] to create offline database objects.  For the demo, I've created a database diagram and drag an existing &lt;span style="font-style: italic;"&gt;EMP &lt;/span&gt;table from the &lt;span style="font-style: italic;"&gt;SCOTT &lt;/span&gt;schema to create a table on it.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-1N7scW6DtqQ/Ti8lKkl1cKI/AAAAAAAAAl8/ul4kcbwqSU0/s1600/EmpOffline.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 200px;" src="http://1.bp.blogspot.com/-1N7scW6DtqQ/Ti8lKkl1cKI/AAAAAAAAAl8/ul4kcbwqSU0/s400/EmpOffline.JPG" alt="" id="BLOGGER_PHOTO_ID_5633762522415067298" border="0" /&gt;&lt;/a&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Adding Comments&lt;/h3&gt;Double-click the &lt;span style="font-style: italic;"&gt;EMP &lt;/span&gt;table component on the diagram to open the &lt;span style="font-style: italic;"&gt;Edit Table &lt;/span&gt;dialog,&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-KwHczRlvmQM/Ti8lgxXn93I/AAAAAAAAAmE/7yYUbTtF16E/s1600/TableComment.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 286px;" src="http://4.bp.blogspot.com/-KwHczRlvmQM/Ti8lgxXn93I/AAAAAAAAAmE/7yYUbTtF16E/s400/TableComment.JPG" alt="" id="BLOGGER_PHOTO_ID_5633762903802247026" border="0" /&gt;&lt;/a&gt;Select &lt;span style="font-style: italic;"&gt;Comment &lt;/span&gt;in the navigation panel to enter table's comment as shown above.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-sYIxpKDoSlc/Ti8l2Pd5cFI/AAAAAAAAAmM/6svvW-nVB4E/s1600/ColumnComment.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 286px;" src="http://3.bp.blogspot.com/-sYIxpKDoSlc/Ti8l2Pd5cFI/AAAAAAAAAmM/6svvW-nVB4E/s400/ColumnComment.JPG" alt="" id="BLOGGER_PHOTO_ID_5633763272658874450" border="0" /&gt;&lt;/a&gt;Select &lt;span style="font-style: italic;"&gt;Columns &lt;/span&gt;in the navigation panel and navigate them one by one.  In the &lt;span style="font-style: italic;"&gt;Comment &lt;/span&gt;field, enter column's comment as shown above.  Click &lt;span style="font-style: italic;"&gt; Save All &lt;/span&gt;to save your work.&lt;br /&gt;&lt;br /&gt;In the &lt;span style="font-style: italic;"&gt;Application Navigator&lt;/span&gt;, under &lt;span class="gui-object"&gt;&lt;span style="font-style: italic;"&gt;Offline Database Sources &lt;/span&gt;| &lt;span style="font-style: italic;"&gt;EMP_DATABASE &lt;/span&gt;| &lt;span style="font-style: italic;"&gt;SCOTT&lt;/span&gt;&lt;/span&gt;, right-click the &lt;span style="font-style: italic;"&gt;EMP &lt;/span&gt;node, and choose &lt;span style="font-style: italic;"&gt;Generate To &lt;/span&gt;&amp;gt; &lt;span style="font-style: italic;"&gt;SQL script ...&lt;/span&gt; to create SQL script file named &lt;span style="font-style: italic;"&gt;emp.sql&lt;/span&gt;.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-Pz5cuSfjnwc/Ti8mlCqMUtI/AAAAAAAAAmU/EuXCAkjlMR0/s1600/SQLScript.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 368px; height: 400px;" src="http://2.bp.blogspot.com/-Pz5cuSfjnwc/Ti8mlCqMUtI/AAAAAAAAAmU/EuXCAkjlMR0/s400/SQLScript.JPG" alt="" id="BLOGGER_PHOTO_ID_5633764076674634450" border="0" /&gt;&lt;/a&gt;Open &lt;span style="font-style: italic;"&gt;emp.sql &lt;/span&gt;in the editor window.  Look for comments of table's and columns' at the bottom of the script as shown below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;COMMENT ON TABLE EMP IS 'Employee Data';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.EMPNO IS 'employee number';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.ENAME IS 'employee name';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.JOB IS 'job description';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.MGR IS 'manager ID';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.HIREDATE IS 'hiring date';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.SAL IS 'salary';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.COMM IS 'commission';&lt;br /&gt;&lt;br /&gt;COMMENT ON COLUMN EMP.DEPTNO IS 'department number';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Select the above comments and copy them into a text file (i.e., &lt;span style="font-style: italic;"&gt;emp.txt&lt;/span&gt;).&lt;br /&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Generating Comment Table&lt;/h3&gt;Start up &lt;span style="font-style: italic;"&gt;Microsoft Excel &lt;/span&gt;and import text file as follows:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-WkpxHFPfvI0/Ti8sbeBKgyI/AAAAAAAAAmc/lLxb5apDfvg/s1600/ImportTextFile.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 229px;" src="http://1.bp.blogspot.com/-WkpxHFPfvI0/Ti8sbeBKgyI/AAAAAAAAAmc/lLxb5apDfvg/s400/ImportTextFile.JPG" alt="" id="BLOGGER_PHOTO_ID_5633770509289816866" border="0" /&gt;&lt;/a&gt;On the &lt;span style="font-style: italic;"&gt;Text Import Wizard&lt;/span&gt;, you specify delimiters using space and paired single quotes as shown below:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-fQjQ4zRFXi0/Ti9CgyTwSdI/AAAAAAAAAmk/PbytrKN6lAQ/s1600/Wizard1_3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 289px;" src="http://1.bp.blogspot.com/-fQjQ4zRFXi0/Ti9CgyTwSdI/AAAAAAAAAmk/PbytrKN6lAQ/s400/Wizard1_3.JPG" alt="" id="BLOGGER_PHOTO_ID_5633794789891656146" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-IIOmcRQcucE/Ti9ClRow8HI/AAAAAAAAAms/chp-E5WaJxI/s1600/Wizard2_3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 289px;" src="http://3.bp.blogspot.com/-IIOmcRQcucE/Ti9ClRow8HI/AAAAAAAAAms/chp-E5WaJxI/s400/Wizard2_3.JPG" alt="" id="BLOGGER_PHOTO_ID_5633794867020755058" border="0" /&gt;&lt;/a&gt;After clicking on &lt;span style="font-style: italic;"&gt;Finish &lt;/span&gt;button, you can remove column A,B, and E.  It will then present you with the final comment table as shown at the beginning of this article.&lt;br /&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;Comment tables generated in the second approach have the following advantages:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The source of comment table is offline database object which can be validated by JDeveloper and can be source controlled.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;They are part of the DB definitions and can be queried as follows:&lt;ul&gt;&lt;li&gt;&lt;pre&gt;select comments&lt;br /&gt;from user_tab_comments&lt;br /&gt;where table_name = 'EMP'&lt;br /&gt;/&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;select column_name, comments&lt;br /&gt;from user_col_comments&lt;br /&gt;where table_name = 'EMP'&lt;br /&gt;order by column_name&lt;br /&gt;/&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;References&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;div id="page_header"&gt;&lt;a href="http://download.oracle.com/docs/cd/E18941_01/tutorials/jdtut_11r2_84/jdtut_11r2_84.html"&gt;Designing and Building Database Tables&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/database%20development/obe_%20dbasedevmt.htm#t3s3"&gt;Database Development with JDeveloper &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/07/modeling-data-with-offline-database-in.html"&gt;Modeling Data with Offline Database in JDeveloper&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-7738116503305711878?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/4Qv5qCh3mUY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/7738116503305711878/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=7738116503305711878" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/7738116503305711878?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/7738116503305711878?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/4Qv5qCh3mUY/beautifying-table-and-column-comments.html" title="Beautifying Table and Column Comments for Design Review" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-e9dylqBHbH4/Ti9PC8MBXCI/AAAAAAAAAm0/_BCJJUNSC9s/s72-c/CommentTable.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/07/beautifying-table-and-column-comments.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IFR38zfSp7ImA9WhdSF00.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-2316986574036769830</id><published>2011-07-26T10:38:00.000-07:00</published><updated>2011-07-26T12:45:16.185-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-26T12:45:16.185-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Offline Database" /><category scheme="http://www.blogger.com/atom/ns#" term="Version Control" /><category scheme="http://www.blogger.com/atom/ns#" term="UML Class Diagram" /><category scheme="http://www.blogger.com/atom/ns#" term="Database Diagram" /><category scheme="http://www.blogger.com/atom/ns#" term="JDeveloper 11g" /><title>Modeling Data with Offline Database in JDeveloper</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uYxQOX0Pevu0cib9FWKqWJzW0Lk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uYxQOX0Pevu0cib9FWKqWJzW0Lk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uYxQOX0Pevu0cib9FWKqWJzW0Lk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uYxQOX0Pevu0cib9FWKqWJzW0Lk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="bText"&gt;  &lt;p&gt;For Oracle Applications developers, the JDeveloper &lt;span style="font-weight: bold;"&gt;offline database modeler  &lt;/span&gt;replaces the &lt;span style="font-style: italic;"&gt;Oracle  Designer repository&lt;/span&gt;, or &lt;span style="font-style: italic;"&gt;CASE &lt;/span&gt;as it was referred  to. Applications developers  should not use SQL DDL scripts for  deployment and source control of  database objects, because they tend to  error-prone and do not serve as a  single source of truth. Instead, developers  should use the JDeveloper &lt;span class="highlight"&gt;offline&lt;/span&gt; database object  files.&lt;/p&gt;&lt;div class="sect1"&gt; &lt;h2 class="sect1" id="insertedID2"&gt;What is the Offline Database&lt;/h2&gt; &lt;p&gt;JDeveloper provides the tools you need to create and  edit database objects, such as tables and constraints, outside the  context of a database, using the offline Database model. You can create  new tables and views, and generate the information to a database, or you  can import database objects from a database schema, make the changes  you want, and generate the changes back to the same database schema, to a  new database schema, or to a file that you can run against a database  at a later date.&lt;/p&gt;&lt;/div&gt; &lt;h3&gt;Offline Database Model&lt;/h3&gt;&lt;p&gt;The JDeveloper Offline database supports the  following object types:  &lt;/p&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;Function&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Materialized View&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Materialized View Log&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Package&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Procedure&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Sequence&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Synonym&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Table&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Trigger &lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Type&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;View&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Currently, JDeveloper &lt;span class="highlight"&gt;offline&lt;/span&gt; DB objects do not support these objects: &lt;/p&gt; &lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Queue&lt;/li&gt;&lt;li&gt;Queue tables&lt;/li&gt;&lt;li&gt;Policy&lt;/li&gt;&lt;li&gt;Context&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;However, SXML persistence files for these object types can be imported using the &lt;span style="font-style: italic;"&gt;applxdf &lt;/span&gt;extension.&lt;/p&gt;  &lt;p&gt;JDeveloper provides tools to create and edit database objects such as   tables, view etc. outside the context of a database. This tool called &lt;span style="color: rgb(0, 0, 0); font-style: italic;" class="highlight"&gt;Offline&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Database Definition&lt;/span&gt; &lt;/span&gt;will  be used to model  physical database objects in Fusion applications. The  migration tool will support migrating  all user selected database  objects defined in CASE to this &lt;span class="highlight"&gt;offline&lt;/span&gt; database definition in JDeveloper along with  SXML/XDF&lt;sup&gt;1&lt;/sup&gt; deployment files.&lt;/p&gt;  &lt;h3&gt;Metadata SXML Comparison Tool&lt;sup&gt;[3]&lt;/sup&gt;&lt;/h3&gt;&lt;p&gt;Offline table definitions can  be version controlled and shared using a source control system.   If you  just create objects in the DB schema via the database navigator, you   have nothing to source control.    JDeveloper provides a comparison tool  optimized for working with offline table definitions, which handles:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;The table data, properties, columns and constraints.&lt;/li&gt;&lt;li&gt;The identity of objects, to track name changes.&lt;/li&gt;&lt;li&gt;Checking for consistency, for example, ensuring:&lt;ul&gt;&lt;li&gt;That a column which is used in a key is not dropped. &lt;/li&gt;&lt;li&gt;That a constraint which uses an absent column is not added. &lt;/li&gt;&lt;li&gt;That a primary key column cannot be options.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Using  this comparison tool, you can compare object metadata of the same type  from different databases.  This comparison depends on SXML.    SXML is  an XML representation which more closely maps to the SQL creation DDL.   Two SXML documents of the same type can be compared and a new SXML  document is provided which describes their differences.&lt;/p&gt;  &lt;p&gt;Using this comparison tool, you're able to:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Compare object definitions in different JDeveloper projects&lt;ul&gt;&lt;li&gt;Since  the objects to be compared are in separate projects, you need to create  a dependency between them to be able to perform this comparison.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Compare versioned copies of DB objects&lt;ul&gt;&lt;li&gt;  Versioning components allows you to browse through the historical  changes of a component and make comparison between these versions.  With  JDEV, it's possible  to compare different versions of database models. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Working on Data Modeling at Different Levels:&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;UML class diagram&lt;/span&gt;&lt;ul&gt;&lt;li&gt;You  can create a logical model using a UML class diagram  to visually  create or inspect classes, interfaces, attributes, operations,  associations, inheritance relationships, and implementation relations  and transform it to an Offline or Online Database definitions later.  &lt;/li&gt;&lt;li&gt;See this &lt;a href="http://download.oracle.com/docs/cd/E18941_01/tutorials/jdtut_11r2_81/jdtut_11r2_81_2.html"&gt;tutorial&lt;/a&gt; for how-to.&lt;/li&gt;&lt;li&gt;You usually do logical modeling using a UML class model in the following steps:&lt;ol&gt;&lt;li&gt;Preparing a class model diagram Environment &lt;/li&gt;&lt;li&gt;Creating a Class Model Diagram &lt;/li&gt;&lt;li&gt;Enhancing the Class Model &lt;/li&gt;&lt;li&gt;Transform the Class Model into a Database Model &lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Database diagram&lt;/span&gt;&lt;ul&gt;&lt;li&gt;You can follow [&lt;a href="http://download.oracle.com/docs/cd/E18941_01/tutorials/jdtut_11r2_84/jdtut_11r2_84.html"&gt;4&lt;/a&gt;, &lt;a href="http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/database%20development/obe_%20dbasedevmt.htm#t3s3"&gt;5&lt;/a&gt;] to create new database diagram.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can also drag tables, views, materialized views, synonyms,  and sequences from a database schema onto a database diagram, where they  become accessible as offline database objects. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Offline Database&lt;/span&gt;&lt;ul&gt;&lt;li&gt;You can create new &lt;span class="highlight"&gt;offline&lt;/span&gt;  database objects, or capture them from a connection to a live database.  After you have finished working with them, you can generate new and  updated database definitions to online database schemas or to SQL  scripts.&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;You can follow the instructions in [&lt;a href="http://download.oracle.com/docs/cd/E18941_01/tutorials/jdtut_11r2_84/jdtut_11r2_84.html"&gt;4&lt;/a&gt;, &lt;a href="http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/database%20development/obe_%20dbasedevmt.htm#t3s3"&gt;5&lt;/a&gt;] to create new offline database objects.&lt;/span&gt;&lt;/span&gt;  When you create an &lt;span class="highlight"&gt;offline&lt;/span&gt; database, you choose  the database emulation (for example, &lt;span style="font-style: italic;"&gt;Oracle11g Database Release 1&lt;/span&gt;) the &lt;span class="highlight"&gt;offline&lt;/span&gt; database should  have.&lt;/li&gt;&lt;li&gt;You  can also copy offline database objects to a project.  In general, it is  a good idea to make sure that the offline database uses the same  database emulation as the  source database.&lt;/li&gt;&lt;li&gt; Note that generation to a database is not certified against non-Oracle databases.  &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h3&gt;Notes&lt;/h3&gt;&lt;p&gt;&lt;span style=";font-family:Helvetica-Narrow-Bold;font-size:100%;"  &gt;&lt;span style=";font-family:Palatino-Roman;font-size:85%;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Prior to SXML migration, these were referred to as xdf (extension)  files.&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;References&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://susanduncan.blogspot.com/" target="_blank" shape="rect"&gt;&lt;strong&gt;http://susanduncan.blogspot.com/&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technology/obe/obe11jdev/ps1/databasedevelopment/obe_%20databasedevmt.htm" target="_blank" shape="rect"&gt;&lt;strong&gt;Database Development with  JDeveloper&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E11882_01/server.112/e17128/chapter1.htm#FEATURENO08689"&gt;Metadata SXML Comparison Tool&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;div id="page_header"&gt;&lt;a href="http://download.oracle.com/docs/cd/E18941_01/tutorials/jdtut_11r2_84/jdtut_11r2_84.html"&gt;Designing and Building Database Tables&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://st-curriculum.oracle.com/obe/jdev/obe1013jdev/10131/database%20development/obe_%20dbasedevmt.htm#t3s3"&gt;Database Development with JDeveloper &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-2316986574036769830?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/Zr1aJfXe_Yg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/2316986574036769830/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=2316986574036769830" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2316986574036769830?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2316986574036769830?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/Zr1aJfXe_Yg/modeling-data-with-offline-database-in.html" title="Modeling Data with Offline Database in JDeveloper" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>1</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/07/modeling-data-with-offline-database-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQAQX48fip7ImA9WhdRFEw.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-8894104087367420341</id><published>2011-07-13T11:12:00.000-07:00</published><updated>2011-08-03T16:32:20.076-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-03T16:32:20.076-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GATE Plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="Semantic Technologies" /><category scheme="http://www.blogger.com/atom/ns#" term="Language Identification" /><category scheme="http://www.blogger.com/atom/ns#" term="General Architecture for Text Engineering" /><category scheme="http://www.blogger.com/atom/ns#" term="GATE" /><title>Language Identification</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S45V4jOhnzx1kTIClCEjKBbKzTI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S45V4jOhnzx1kTIClCEjKBbKzTI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S45V4jOhnzx1kTIClCEjKBbKzTI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S45V4jOhnzx1kTIClCEjKBbKzTI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;Language identification &lt;/span&gt;is one of the supervised learning method.  In  this article, we will cover a specific &lt;span style="font-style: italic;"&gt;Processing Resource&lt;/span&gt; (&lt;span style="font-weight: bold;"&gt;PR&lt;/span&gt;) in &lt;a href="http://gate.ac.uk/"&gt;GATE  &lt;/a&gt;(i.e., &lt;span style="font-style: italic;"&gt;TextCat &lt;/span&gt;or &lt;a style="font-style: italic;" rel="nofollow"&gt;Language Identification&lt;/a&gt; PR).  Based on its documentation, it says that it: &lt;blockquote&gt; &lt;p&gt;Recognizes the document language using TextCat. Possible languages: &lt;span style="font-style: italic;"&gt; german&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;english&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;french&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;spanish&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;italian&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;swedish&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;polish&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;dutch&lt;/span&gt;, &lt;span style="font-style: italic;"&gt; norwegian&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;finnish&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;albanian&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;slovakian&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;slovenian&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;danish&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;hungarian&lt;/span&gt;.&lt;/p&gt;&lt;/blockquote&gt;  &lt;h3&gt;&lt;a name="LanguageIdentification-NGramBasedTextCategorization"&gt;&lt;/a&gt;N-Gram-Based Text Categorization&lt;/h3&gt;  &lt;p&gt;TextCat PR uses &lt;a href="http://en.wikipedia.org/wiki/N-gram"&gt;&lt;span style="font-weight: bold;"&gt;N-Gram&lt;/span&gt;&lt;/a&gt; for text categorization.  You can find the details from this &lt;a href="http://lesfourmisrouges.com/bs/documentation/@%20work/sdair-94-bc.pdf" rel="nofollow"&gt;article&lt;/a&gt;.  See the following diagram for its data flow.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-qZzgsYMXJmE/Th3hCgnbHvI/AAAAAAAAAlQ/dAq_YYnr8Nc/s1600/N-Gram.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 271px; height: 400px;" src="http://1.bp.blogspot.com/-qZzgsYMXJmE/Th3hCgnbHvI/AAAAAAAAAlQ/dAq_YYnr8Nc/s400/N-Gram.JPG" alt="" id="BLOGGER_PHOTO_ID_5628902542514265842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There are two phases in the language identification task:&lt;br /&gt;&lt;ol&gt;&lt;li style="font-weight: bold;"&gt;Training&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Application&lt;/li&gt;&lt;/ol&gt;   &lt;p&gt;We'll discuss those in the following sections.&lt;/p&gt;  &lt;h3&gt;&lt;a name="LanguageIdentification-TrainingPhase"&gt;&lt;/a&gt;Training Phase&lt;/h3&gt;  &lt;p&gt;In the training phase, the goal is to generate category profiles  from the given category samples.  In &lt;span style="font-style: italic;"&gt;Language Identification &lt;/span&gt;PR (or &lt;span style="font-style: italic;"&gt;TextCat &lt;/span&gt;PR),  the categories are languages.  So, we take document samples from  different languages (i.e., &lt;span style="font-style: italic;"&gt;English&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;German&lt;/span&gt;, etc.) and use them to  generate category profiles.&lt;/p&gt;  &lt;p&gt;These category profiles are already provided in &lt;span style="font-style: italic;"&gt;TextCat &lt;/span&gt;PR.  At  runtime, &lt;span style="font-style: italic;"&gt;TextCat &lt;/span&gt;PR looks for a configuration file named &lt;span style="font-weight: bold; font-style: italic;"&gt;textcat.conf&lt;/span&gt;.   This files has the following content:&lt;/p&gt; &lt;div class="code panel" style="border-width: 1px;"&gt;&lt;div class="codeContent panelContent"&gt; &lt;pre class="code-java"&gt;language_fp/german.lm    german&lt;br /&gt;language_fp/english.lm    english&lt;br /&gt;language_fp/french.lm    french&lt;br /&gt;language_fp/spanish.lm    spanish&lt;br /&gt;language_fp/italian.lm    italian&lt;br /&gt;language_fp/swedish.lm    swedish&lt;br /&gt;language_fp/polish.lm    polish&lt;br /&gt;language_fp/dutch.lm    dutch&lt;br /&gt;language_fp/norwegian.lm    norwegian&lt;br /&gt;language_fp/finnish.lm    finnish&lt;br /&gt;language_fp/albanian.lm    albanian&lt;br /&gt;language_fp/slovak-ascii.lm    slovakian&lt;br /&gt;language_fp/slovenian-ascii.lm    slovenian&lt;br /&gt;language_fp/danish.lm    danish&lt;br /&gt;language_fp/hungarian.lm    hungarian  &lt;/pre&gt; &lt;/div&gt;&lt;/div&gt; &lt;p&gt;In a sub-folder named&lt;span style="font-weight: bold; font-style: italic;"&gt; language_fp&lt;/span&gt; which is relative to the location  of &lt;span style="font-weight: bold; font-style: italic;"&gt;textcat.conf&lt;/span&gt;, there are multiple category profile files with &lt;span style="font-style: italic; font-weight: bold;"&gt;lm&lt;/span&gt; suffix.  For example, &lt;span style="font-style: italic;"&gt;german.lm&lt;/span&gt; is the category profile for &lt;span style="font-style: italic;"&gt;German &lt;/span&gt;and  &lt;span style="font-style: italic;"&gt;english.lm&lt;/span&gt; is the category profile for &lt;span style="font-style: italic;"&gt;English&lt;/span&gt;.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Using English profile as an example, its content looks like this:&lt;br /&gt;&lt;/p&gt; &lt;div class="code panel" style="border-width: 1px;"&gt;&lt;div class="codeContent panelContent"&gt; &lt;pre class="code-java"&gt;_     20326&lt;br /&gt;e     6617&lt;br /&gt;t     4843&lt;br /&gt;o     3834&lt;br /&gt;n     3653&lt;br /&gt;i     3602&lt;br /&gt;a     3433&lt;br /&gt;s     2945&lt;br /&gt;r     2921&lt;br /&gt;h     2507&lt;br /&gt;e_     2000&lt;br /&gt;d     1816&lt;br /&gt;_t     1785&lt;br /&gt;c     1639&lt;br /&gt;l     1635&lt;br /&gt;th     1535&lt;br /&gt;he     1351&lt;br /&gt;_th     1333&lt;br /&gt;...&lt;/pre&gt; &lt;/div&gt;&lt;/div&gt; &lt;p&gt;On each line, there are two elements:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;N-gram (&lt;span style="font-style: italic;"&gt;N &lt;/span&gt;is from 1 to 5)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Frequency&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;N-grams are sorted in the reverse order of frequency.  For example,  the most frequently found character in English documents is the space  character (i.e., represented by '_') whose count of occurrences is 20326.  From the training data, we also find that the most frequently found 2-gram is 'e_' (i.e., letter 'e' followed by a space). &lt;/p&gt;  &lt;h3&gt;&lt;a name="LanguageIdentification-ApplicationPhase"&gt;&lt;/a&gt;Application Phase&lt;/h3&gt;  &lt;p&gt;&lt;br /&gt;In the application phase, the &lt;span style="font-style: italic;"&gt;TextCat &lt;/span&gt;PR reads the learned model             (i.e., category profiles ) and then applies            the model to  the data.             Given a new document, first we generate a &lt;span style="font-style: italic;"&gt;document  profile&lt;/span&gt; (i.e., N-grams frequency profile) similar to the category  profiles.  &lt;/p&gt;  &lt;p&gt;The language classification task is then to measure &lt;span style="font-style: italic;"&gt;profile  distance&lt;/span&gt;:  For each N-gram in the &lt;span style="font-style: italic;"&gt;document profile&lt;/span&gt;, we find its  counterpart in the &lt;span style="font-style: italic;"&gt;category profile&lt;/span&gt;, and then calculate how far out of  place it is.&lt;/p&gt;  &lt;p&gt;Finally, the bubble labelled "&lt;span style="font-style: italic;"&gt;Find Minimum Distance&lt;/span&gt;" simply takes the  distance measures from all of the category profiles to the document  profile, and picks the smallest one.&lt;/p&gt;  &lt;h3&gt;What's in TextCat PR?&lt;/h3&gt;  &lt;p&gt;If you look inside the &lt;span style="font-style: italic;"&gt;textcat-1.0.1.jar&lt;/span&gt;, you can identify the following structure:&lt;br /&gt;&lt;/p&gt; &lt;div class="preformatted panel" style="border-width: 1px;"&gt;&lt;div class="preformattedContent panelContent"&gt; &lt;pre&gt;org/&lt;br /&gt;+--knallgrau/&lt;br /&gt;+--utils/&lt;br /&gt; +-- textcat/&lt;br /&gt;    +-- FingerPrint.java&lt;br /&gt;    +-- MyProperties.java&lt;br /&gt;    +-- NGramEntryComparator.java&lt;br /&gt;    +-- TextCategorizer.java&lt;br /&gt;    +-- textcat.conf&lt;br /&gt;    +-- language_fp/&lt;br /&gt;        +-- english.lm&lt;br /&gt;        +-- german.lm&lt;br /&gt;        +-- ...  &lt;/pre&gt; &lt;/div&gt;&lt;/div&gt; &lt;p&gt;Unfortunately, you cannot find the above source files from GATE's  downloads. However, after Google search, I've found them from Google Code &lt;a href="http://code.google.com/p/reco-gnizr/source/browse/trunk/src/edu/umbc/textcat/TextCategorizer.java?spec=svn148&amp;amp;r=148" rel="nofollow"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-8894104087367420341?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/o8hD-L3t55M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/8894104087367420341/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=8894104087367420341" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/8894104087367420341?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/8894104087367420341?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/o8hD-L3t55M/language-identification.html" title="Language Identification" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-qZzgsYMXJmE/Th3hCgnbHvI/AAAAAAAAAlQ/dAq_YYnr8Nc/s72-c/N-Gram.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/07/language-identification.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UNSHo4fCp7ImA9WhdXEEo.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-2583099260221924504</id><published>2011-07-09T11:26:00.000-07:00</published><updated>2011-08-22T20:48:19.434-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-22T20:48:19.434-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Data Warehouse" /><category scheme="http://www.blogger.com/atom/ns#" term="OWB" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Warehouse Builder" /><category scheme="http://www.blogger.com/atom/ns#" term="Star Schema" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><category scheme="http://www.blogger.com/atom/ns#" term="Cube and Dimensions" /><title>Book Review: "Oracle Warehouse Builder 11g R2: Getting Started 2011"</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1Oji7R5B4xQlIuyI4AmLh6fVPb4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1Oji7R5B4xQlIuyI4AmLh6fVPb4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1Oji7R5B4xQlIuyI4AmLh6fVPb4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1Oji7R5B4xQlIuyI4AmLh6fVPb4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/-lCcNH1g5MjY/TiMVZJ7R5-I/AAAAAAAAAls/h1mRx43QC8U/s1600/OWB_cover.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 337px; height: 400px;" src="http://3.bp.blogspot.com/-lCcNH1g5MjY/TiMVZJ7R5-I/AAAAAAAAAls/h1mRx43QC8U/s400/OWB_cover.JPG" alt="" id="BLOGGER_PHOTO_ID_5630367481048721378" border="0" /&gt;&lt;/a&gt;&lt;h3&gt;What's Data Warehouse&lt;/h3&gt; A &lt;span style="font-weight: bold;"&gt;data warehouse &lt;/span&gt;is a database used for reporting.  The main source of the data is cleaned, transformed, cataloged  and made available for use by managers and other business professionals  for data mining, online analytical processing, market research and  decision support (Marakas &amp;amp; OBrien 2009).
&lt;br /&gt;
&lt;br /&gt;The data warehouse must handle large amounts of data, and must be simple to query and understand by the end users. A data warehouse maintains its functions in three layers:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Staging&lt;/span&gt;— used to store raw data for use by developers (analysis and support).&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Integration&lt;/span&gt;—used to integrate data and to have a level of abstraction from users.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Access&lt;/span&gt;— for getting data out for users&lt;/li&gt;&lt;/ul&gt; &lt;div&gt;&lt;/div&gt;&lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Data Warehouse vs. Transactional Database
&lt;br /&gt;&lt;/h3&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;A &lt;span style="font-weight: bold;"&gt;data warehouse&lt;/span&gt; (DW) is different from a &lt;span style="font-weight: bold;"&gt;transactional database&lt;/span&gt; (TD).  A DW is a database used for reporting where the focus is getting data out of the system.  On the other hands,  TD is concerned with daily operational processing where the focus is on getting data into the system.
&lt;br /&gt;
&lt;br /&gt;In the design, TD uses &lt;span style="font-weight: bold;"&gt;normalized &lt;/span&gt;approach  while DW chooses &lt;span style="font-weight: bold;"&gt;dimensional &lt;/span&gt;approach.
&lt;br /&gt;
&lt;br /&gt;The normalized structure divides data into entities, which creates several tables in a relational database. When applied in large enterprises the result is dozens of tables that are linked together by a web of joins.
&lt;br /&gt;
&lt;br /&gt;In a dimensional approach, transaction data are partitioned into either &lt;span style="font-weight: bold;"&gt;facts&lt;/span&gt; (actual numerical measures) and  &lt;span style="font-weight: bold;"&gt;dimensions&lt;/span&gt; (descriptive data about those measures) that place the facts in a context that is understandable to the end-user decision maker.
&lt;br /&gt;
&lt;br /&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/div&gt; In this article, we will review a book  named &lt;a href="https://www.packtpub.com/oracle-soa-suite-11g-r1-developers-guide/book"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://link.packtpub.com/QhHAoh" target="_blank"&gt;Oracle Warehouse Builder 11g R2: Getting Started 2011&lt;/a&gt;, in which it addresses  &lt;span style="font-style: italic;"&gt;Oracle Warehouse Builder &lt;/span&gt;(i.e., one of the Oracle's data mining solutions).
&lt;br /&gt;&lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Introduction of the Book&lt;/h3&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;If you are new to data warehousing and need a way to get started, this book offers great help.  The task of designing a data warehouse is nontrivial and you can use some helps from a good tool.  On this, I agree with the author:
&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;Oracle Warehouse Builder is a great application to use to build your warehouse.&lt;/blockquote&gt;This  book provides good coverage on both the theory of data warehousing and  practical ways of implementing a data warehouse that can be directly applied in the real world.  It's the final product of author's 27 years' working experience in the database industry and his thorough and careful research on the &lt;span style="font-style: italic;"&gt;Oracle Warehouse Builder&lt;/span&gt;.
&lt;br /&gt;
&lt;br /&gt;The following books are perused and referenced by the author:
&lt;br /&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style=";font-family:'Book Antiqua';font-size:13px;"  &gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;Oracle Warehouse Builder Data Modeling, ETL and Data Quality Guide
&lt;br /&gt;&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Oracle Warehouse Builder Concepts Guide&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Oracle Database SQL Language Reference&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Oracle Warehouse Builder Users Guide&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Oracle Database Error Messages 11g Release 2(11.2)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;The Data Warehouse Toolkit: The Complete Guide to Dimensional Modeling&lt;/span&gt;
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;/div&gt; &lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Oracle Warehouse Builder (OWB)
&lt;br /&gt;&lt;/h3&gt;  &lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;The &lt;span style="font-style: italic;"&gt;Oracle Warehouse Builder &lt;/span&gt;is a tool provided by &lt;span style="font-style: italic;"&gt;Oracle&lt;/span&gt;, which can be used at every stage of the implementation of a data warehouse, from initial design and creation of the table structure to the extract, transform, and load (ETL) process and data-quality management.
&lt;br /&gt;
&lt;br /&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;OWB has the ability to design the objects logically using &lt;span style="font-weight: bold;"&gt;cubes &lt;/span&gt;and &lt;span style="font-weight: bold;"&gt;dimensions &lt;/span&gt;in a dimensional design.  It also has the ability to implement them physically in the underlying database as either a &lt;span style="font-weight: bold;"&gt;relational structure &lt;/span&gt;or a &lt;span style="font-weight: bold;"&gt;dimensional structure &lt;/span&gt;simply by checking a box.  For a relational implementation (physical implementation), OWB actually provides us two options for implementing the database:
&lt;br /&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;Pure relational option &lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Relational OLAP option&lt;/li&gt;&lt;/ul&gt;In the Figure below, it shows OWB components and its architecture:
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-PxjVMk3nHoc/TiM7Kl6NNXI/AAAAAAAAAl0/93wtVr0t7kM/s1600/OWB_architecture.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 288px;" src="http://1.bp.blogspot.com/-PxjVMk3nHoc/TiM7Kl6NNXI/AAAAAAAAAl0/93wtVr0t7kM/s400/OWB_architecture.JPG" alt="" id="BLOGGER_PHOTO_ID_5630409012304229746" border="0" /&gt;&lt;/a&gt;  &lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span&gt;&lt;i&gt;
&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;h3&gt;ACME Toys and Gizmos&lt;span style="border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Tahoma;font-size:medium;"  &gt;&lt;span&gt;&lt;i&gt;
&lt;br /&gt; &lt;/i&gt;&lt;/span&gt;&lt;/span&gt; &lt;/h3&gt; In this book, a fictional organization named &lt;span style="font-style: italic;"&gt;ACME Toys and Gizmos&lt;/span&gt; is used to demonstrate practical ways of implementing a data warehouse that can be directly applied in the real world.  This book provides explanations throughout on how to use the &lt;span style="font-style: italic;"&gt;Oracle  Warehouse Builder &lt;/span&gt;tool to build a data warehouse within the context of  this invented company, which is involved in storefront and online Internet sales.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;For instance, a customer makes a purchase of a toy with &lt;span style="font-style: italic;"&gt;ACME Toys and  Gizmos &lt;/span&gt;on a particular day over the &lt;span style="font-style: italic;"&gt;Internet&lt;/span&gt;, which results in a dollar  amount of the transaction. The dollar amount becomes the fact and the  toy purchased, the customer, and the location of the purchase (the  Internet in this case) become the dimensions that provide a scope of the  fact measurement and give it a meaning.
&lt;br /&gt;
&lt;br /&gt;The design of the data warehouse is drawn out in a &lt;span style="font-weight: bold;"&gt;star schema &lt;/span&gt;configuration showing the cube, which is surrounded by the dimensions with the individual items of information (attributes) .  It looks like the following:
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-PdynapTcYtY/TiMRMY1nKRI/AAAAAAAAAlk/RSpuscXaIUU/s1600/starSchema.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 269px;" src="http://2.bp.blogspot.com/-PdynapTcYtY/TiMRMY1nKRI/AAAAAAAAAlk/RSpuscXaIUU/s400/starSchema.JPG" alt="" id="BLOGGER_PHOTO_ID_5630362863666669842" border="0" /&gt;&lt;/a&gt;
&lt;br /&gt;With Star Schema, managers  can easily use the data for data mining, online analytical processing, market research and decision support.   For example, if a manager for &lt;span style="font-style: italic;"&gt;ACME Toys and Gizmos&lt;/span&gt; needs to know what products sold well in the last quarter, the query will only involve two tables—the main fact table containing the data on number of items sold and the product dimension table that contains all the information about the product.    &lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Summary&lt;/h3&gt; The purpose of this book is to introduce the &lt;span style="font-weight: bold;"&gt;Oracle Warehouse Builder &lt;/span&gt;and use it to design and build your first data warehouse.   By following author's carefully designed components and instructions, you will easily achieve that goal.
&lt;br /&gt;&lt;h3&gt;
&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;See Also&lt;/h3&gt; &lt;ol&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/developer-tools/warehouse/overview/introduction/index.html"&gt;Oracle Warehouse Builder (OWB) 11g &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://www.packtpub.com/oracle-soa-suite-11g-r1-developers-guide/book"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://link.packtpub.com/QhHAoh" target="_blank"&gt;Oracle Warehouse Builder 11g R2: Getting Started 2011&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The Data Warehouse Toolkit: The Complete Guide to Dimensional Modeling&lt;/li&gt;&lt;li&gt;Oracle Warehouse Builder Data Modeling, ETL and Data Quality Guide
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Oracle Warehouse Builder Concepts Guide&lt;/li&gt;&lt;li&gt;Oracle Database SQL Language Reference&lt;/li&gt;&lt;li&gt;Oracle Warehouse Builder Users Guide&lt;/li&gt;&lt;li&gt;Oracle Database Error Messages 11g Release 2(11.2)&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-2583099260221924504?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/MebYAo2yiK8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/2583099260221924504/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=2583099260221924504" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2583099260221924504?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2583099260221924504?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/MebYAo2yiK8/book-review-of-oracle-warehouse-builder.html" title="Book Review: &quot;Oracle Warehouse Builder 11g R2: Getting Started 2011&quot;" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-lCcNH1g5MjY/TiMVZJ7R5-I/AAAAAAAAAls/h1mRx43QC8U/s72-c/OWB_cover.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/07/book-review-of-oracle-warehouse-builder.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQDQHc4eip7ImA9WhdRFEw.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-1516248275468061849</id><published>2011-06-19T13:55:00.000-07:00</published><updated>2011-08-03T16:32:51.932-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-03T16:32:51.932-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Property Chain Axiom" /><category scheme="http://www.blogger.com/atom/ns#" term="OWLPrime" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Database 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="OWL2RL" /><category scheme="http://www.blogger.com/atom/ns#" term="Ontology" /><category scheme="http://www.blogger.com/atom/ns#" term="Semantic Technologies" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle Database Semantic Technologies" /><title>How to Support Property Chain Axiom Using Oracle's OWL Prime</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/q5xRACge9cLHCLLxYHkE8SCerRA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q5xRACge9cLHCLLxYHkE8SCerRA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/q5xRACge9cLHCLLxYHkE8SCerRA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q5xRACge9cLHCLLxYHkE8SCerRA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In this article, we will show how to support &lt;span style="font-weight: bold;"&gt;Property Chain Axiom &lt;/span&gt;using OWLPrime rulebase in &lt;a href="http://xmlandmore.blogspot.com/2011/02/overview-of-oracle-database-semantic.html"&gt;Oracle Semantic Technologies&lt;/a&gt;.&lt;br /&gt;&lt;h5&gt;&lt;span style="font-size:130%;"&gt;What Oracle Semantic Supports?&lt;/span&gt;&lt;/h5&gt;Oracle Semantic Technologies support the following rule set (but not limited to these):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;OWLSIF (OWL with IF semantics)  &lt;ul&gt;&lt;li&gt;Based on Dr. Horst's pD* vocabulary&lt;/li&gt;&lt;/ul&gt;  &lt;/li&gt;&lt;li&gt;OWLPrime&lt;/li&gt;&lt;li&gt;OWL2RL&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;If you are using 11.2.0.1, you can find OWl 2 RL support in the following patch on &lt;a href="http://support.oracle.com/"&gt;support.oracle.com&lt;/a&gt;:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Patch Number 9819833 - semantic technologies 11g r2 fix bundle 2&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;Note that Semantic 11.2.0.2 comes with OWl 2 RL support.&lt;/p&gt;&lt;h5&gt;&lt;a name="KnowledgeRepresetationUsingRDFandOWL-WhatOracleSemanticSupports?"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Property Chain Axiom&lt;/span&gt;&lt;/span&gt;&lt;sup style="font-weight: bold;"&gt;[5]&lt;/sup&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Table 1 specifies the semantic conditions on property chain axiom:&lt;br /&gt;&lt;/p&gt;&lt;table border="2" cellpadding="5"&gt; &lt;tbody&gt;&lt;tr&gt;       &lt;td style="vertical-align: top; font-weight: bold;"&gt;&lt;big&gt;&lt;br /&gt;&lt;/big&gt;&lt;/td&gt;       &lt;td style="vertical-align: top; font-weight: bold;"&gt;&lt;big&gt;If&lt;br /&gt;&lt;/big&gt;&lt;/td&gt;       &lt;td style="vertical-align: top; font-weight: bold;"&gt;&lt;big&gt;Then&lt;br /&gt;&lt;/big&gt;&lt;/td&gt;     &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;span class="name" id="prp-spo2"&gt;prp-spo2&lt;/span&gt; &lt;/td&gt;&lt;td class="name"&gt; T(?p, owl:propertyChainAxiom, ?x)&lt;br /&gt;LIST[?x, ?p&lt;sub&gt;1&lt;/sub&gt;, ..., ?p&lt;sub&gt;n&lt;/sub&gt;]&lt;br /&gt;T(?u&lt;sub&gt;1&lt;/sub&gt;, ?p&lt;sub&gt;1&lt;/sub&gt;, ?u&lt;sub&gt;2&lt;/sub&gt;)&lt;br /&gt;T(?u&lt;sub&gt;2&lt;/sub&gt;, ?p&lt;sub&gt;2&lt;/sub&gt;, ?u&lt;sub&gt;3&lt;/sub&gt;)&lt;br /&gt;...&lt;br /&gt;T(?u&lt;sub&gt;n&lt;/sub&gt;, ?p&lt;sub&gt;n&lt;/sub&gt;, ?u&lt;sub&gt;n+1&lt;/sub&gt;) &lt;/td&gt;&lt;td class="name"&gt; T(?u&lt;sub&gt;1&lt;/sub&gt;, ?p, ?u&lt;sub&gt;n+1&lt;/sub&gt;)&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;span style="font-style: italic;"&gt;Property chain axiom &lt;/span&gt;allows reasoner to infer the existence of a property from a chain of properties.  For example,  the following &lt;span style="font-style: italic;"&gt;hasContained &lt;/span&gt;semantic using property chain axiom :&lt;br /&gt;&lt;pre&gt;hasContained(x, "EOS 60D") ^ rdf:type("EOS 60D","Digital SLR Cameras")&lt;br /&gt;-&amp;gt; hasContained(x,"Cameras")&lt;br /&gt;&lt;br /&gt;&amp;lt;rdf:description about="hasContained"&amp;gt;&lt;br /&gt;&amp;lt;owl:propertychainaxiom parsetype="Collection"/&amp;gt;&lt;br /&gt;&amp;lt;owl:objectproperty about="hasContained"/&amp;gt;&lt;br /&gt;&amp;lt;owl:objectproperty about="&amp;amp;rdf;type"&amp;gt;&lt;br /&gt;&amp;lt;/owl:propertychainaxiom&amp;gt;&lt;br /&gt;&amp;lt;/rdf:description&amp;gt;&lt;br /&gt;&lt;/pre&gt;to derive the fact that an article is related to the topic "Cameras" if it contains the key words "EOS 60D" because "EOS 60D" is a &lt;span style="font-style: italic;"&gt;rdf:type &lt;/span&gt;of "Digital SLR Cameras" which is, in turn,  a &lt;span style="font-style: italic;"&gt;owl:subClassOf &lt;/span&gt; of "Cameras".  Our camera ontology example looks like this:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-O2FoRhwJnBE/Tf57z-Gr-CI/AAAAAAAAAlI/yQfojcMHq1c/s1600/CameraOnt.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 333px;" src="http://3.bp.blogspot.com/-O2FoRhwJnBE/Tf57z-Gr-CI/AAAAAAAAAlI/yQfojcMHq1c/s400/CameraOnt.bmp" alt="" id="BLOGGER_PHOTO_ID_5620065517779548194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Using Oracle's OWLPrime rule set, it doesn't support the above inference directly.  What it can infer is just:&lt;br /&gt;&lt;pre&gt;rdf:type("EOS 60D", "Digital SLR Cameras") ^&lt;br /&gt;owl:subClassOf("Digital SLR Cameras","Cameras") -&amp;gt; rdf:type("EOS 60D","Cameras")&lt;br /&gt;&lt;/pre&gt;However, this is different from what we want.  To enable Oracle Semantic to support what we want using OWLPrime rule set, we need to:&lt;span style="font-size:130%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;Specify chain definition RDF triples&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Specify 'CHAIN' for the &lt;code&gt;inf_components_in&lt;/code&gt; argument in SEM_APIS.CREATE_ENTAILMENT()&lt;/li&gt;&lt;/ul&gt;Note that OWL2RL has more rules than OWLPrime does and you can use it to achieve the above task directly. However, the more rules     you  include in the inference, the slower performance you get.  That's the reason why we document the steps here to allow users to use OWLPrime instead of OWL2RL for property chain.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Chain Definition Triples&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first requirement is to insert the necessary chain definition triples for &lt;span style="font-style: italic;"&gt;hasContained &lt;/span&gt;semantic into your ontology model:&lt;br /&gt;&lt;br /&gt;prefix &lt;span style="font-family:monospace;"&gt;prop&lt;/span&gt;&lt;code&gt;:&lt;/code&gt;, namespace URI:         &lt;code&gt;&lt;span style="font-family:Georgia,serif;"&gt;http://xmlns.oracle.com/rdfctx/property#&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;prefix &lt;code&gt;owl:&lt;/code&gt;, namespace URI:         &lt;code&gt;http://www.w3.org/2002/07/owl#&lt;/code&gt;&lt;br /&gt;prefix &lt;code&gt;rdf:&lt;/code&gt;, namespace URI:         &lt;code&gt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&lt;/code&gt;&lt;br /&gt;&lt;pre&gt;prop:hasContained  owl:propertyChainAxiom _:jA1 .&lt;br /&gt;_:jA1              rdf:first              prop:hasContained .&lt;br /&gt;_:jA1              rdf:rest               _:jA2.&lt;br /&gt;_:jA2              rdf:first              rdf:type .&lt;br /&gt;_:jA2              rdf:rest               rdf:nil . &lt;/pre&gt;To insert the above chain definition triples, you can use the following &lt;code&gt;INSERT&lt;/code&gt; statements:&lt;br /&gt;&lt;pre&gt;INSERT INTO ontology_rdf_data VALUES(ONTOLOGY_S1.nextval,&lt;br /&gt;sdo_rdf_triple_s('ontology_model',&lt;br /&gt;'&amp;lt;http://xmlns.oracle.com/rdfctx/property#hasContained&amp;gt;',&lt;br /&gt;'&amp;lt;http://www.w3.org/2002/07/owl#propertyChainAxiom&amp;gt;',&lt;br /&gt;'_:jA1'));&lt;br /&gt;&lt;br /&gt;INSERT INTO ontology_rdf_data VALUES(ONTOLOGY_S1.nextval,&lt;br /&gt;sdo_rdf_triple_s('ontology_model','_:jA1',&lt;br /&gt;'&amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#first&amp;gt;',&lt;br /&gt;'&amp;lt;http://xmlns.oracle.com/rdfctx/property#hasContained&amp;gt;'));&lt;br /&gt;&lt;br /&gt;INSERT INTO ontology_rdf_data VALUES(ONTOLOGY_S1.nextval,&lt;br /&gt;sdo_rdf_triple_s('ontology_model',&lt;br /&gt;'_:jA1', '&amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#rest&amp;gt;',&lt;br /&gt;'_:jA2'));&lt;br /&gt;&lt;br /&gt;INSERT INTO ontology_rdf_data VALUES(ONTOLOGY_S1.nextval,&lt;br /&gt;sdo_rdf_triple_s('ontology_model','_:jA2',&lt;br /&gt;'&amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#first&amp;gt;',&lt;br /&gt;'&amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&amp;gt;'));&lt;br /&gt;&lt;br /&gt;INSERT INTO ontology_rdf_data VALUES(ONTOLOGY_S1.nextval,&lt;br /&gt;sdo_rdf_triple_s('ontology_model',&lt;br /&gt;'_:jA2', '&amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#rest&amp;gt;',&lt;br /&gt;'&amp;lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#nil&amp;gt;'));&lt;br /&gt;&lt;/pre&gt;Note that our ontology_model is created as:&lt;br /&gt;&lt;pre&gt;-- create application table&lt;br /&gt;create table ontology_rdf_data (&lt;br /&gt;triple_id  NUMBER(18) NOT NULL,&lt;br /&gt;triple SDO_RDF_TRIPLE_S,&lt;br /&gt;CONSTRAINT ontology_rdf_data_pk PRIMARY KEY  (triple_id)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;-- create the RDF Model --&lt;br /&gt;begin&lt;br /&gt;sem_apis.create_rdf_model (model_name =&amp;gt; 'ontology_model',&lt;br /&gt;table_name =&amp;gt; 'ontology_rdf_data',&lt;br /&gt;column_name =&amp;gt; 'triple');&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;SEM_APIS.CREATE_ENTAILMENT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you use &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28397/sdo_rdf_concepts.htm#CHDJACII"&gt;SEM_MATCH &lt;/a&gt;table function to query semantic data, it is required that you create a rules index using  &lt;a href="http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28397/sem_apis_ref.htm#autoId7"&gt;SEM_APIS.CREATE_ENTAILMENT&lt;/a&gt;.  The rules index will contain precomputed triples inferred from RDF model(s) and rulebase(s).&lt;br /&gt;&lt;br /&gt;Here we describe how to set up rules index correctly for supporting property chain.  First, if you have already created the rules index, drop it first:&lt;pre&gt;BEGIN&lt;br /&gt;SEM_APIS.DROP_ENTAILMENT('rule_index_1');&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The second step is to run inference on default graph:&lt;br /&gt;&lt;br /&gt;exec sem_apis.create_entailment('rule_index_1',sem_models('ontology_model','model_1'),&lt;b&gt;&lt;span style="color:#FF4635;"&gt;sem_rulebases('owlprime'),inf_components_in =&amp;gt; 'CHAIN'&lt;/span&gt;&lt;/b&gt;, include_default_g =&amp;gt; sem_models('ontology_model','model_1'));&lt;br /&gt;&lt;br /&gt;Finally, you run NG-based (i.e., Name Graph) local inference:&lt;br /&gt;&lt;br /&gt;exec sem_apis.create_entailment('rule_index_1',sem_models('ontology_model','model_1'),&lt;span style="color:#FF4635;"&gt;sem_rulebases('owlprime'),  inf_components_in =&amp;gt; 'CHAIN'&lt;/span&gt;, options =&amp;gt;'ENTAIL_ANYWAY=T,LOCAL_NG_INF=T');&lt;br /&gt;commit;&lt;br /&gt;&lt;br /&gt;Unless you specify below argument&lt;br /&gt;&lt;span style="color:#FF4635;"&gt;inf_components_in =&amp;gt; 'CHAIN'&lt;br /&gt;&lt;/span&gt;the reasoner won't support property chain using OWLPrime rulebase.&lt;br /&gt;&lt;br /&gt;Note that there are two RDF models used in the above global and local inference(s):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ontology_model (i.e., TBox)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;model_1 (i.e., ABox)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Global Inference vs. Local Inference&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Global inference takes all asserted triples from all the source model(s) provided and applies semantic rules on top of all the asserted triples till an inference closure is reached.  Even if the given source models contain one more multiple named graphs, it actually makes no difference to global inference because all assertions, whether part of a named graph or not, are treated the same as if they come from a single graph.&lt;br /&gt;&lt;br /&gt;On the other hand, local inference is performed within the boundary of every single named graph combined with the common schema.  See Oracle documentation for more details.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/owl2-profiles/#Reasoning_in_OWL_2_RL_and_RDF_Graphs_using_Rules"&gt;OWL 2 Web Ontology Language Profiles&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11828/owl_concepts.htm#CHDJBGFI"&gt;Oracle's Support for a Subset of the Web Ontology Language (OWL)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/2007/OWL/wiki/OracleOwlPrime"&gt;The Fragment of OWL Implemented in Oracle 11g&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/rdf-schema/#ch_type"&gt;rdf:type&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/2009/WD-owl2-primer-20090421/#Property_Chains"&gt;Property Chains&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.proxml.be/users/paul/weblog/0a621/SKOS_part_4_property_chains.html"&gt;SKOS (part 4): property chains&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-1516248275468061849?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/1GNzzBBdrDM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/1516248275468061849/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=1516248275468061849" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/1516248275468061849?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/1516248275468061849?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/1GNzzBBdrDM/how-to-support-property-chain-axiom.html" title="How to Support Property Chain Axiom Using Oracle's OWL Prime" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-O2FoRhwJnBE/Tf57z-Gr-CI/AAAAAAAAAlI/yQfojcMHq1c/s72-c/CameraOnt.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/06/how-to-support-property-chain-axiom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQGQHY9eip7ImA9WhdRGE4.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-7316040042538211566</id><published>2011-06-15T12:51:00.000-07:00</published><updated>2011-08-08T13:45:21.862-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-08T13:45:21.862-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Reusable Components" /><category scheme="http://www.blogger.com/atom/ns#" term="Application Module" /><category scheme="http://www.blogger.com/atom/ns#" term="Fusion Web Applications" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle ADF 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="ADF Library JAR" /><title>Reusable ADF Components—Application Modules</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/E5PLc5MDeYsqNtku4vPwZz7rahA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E5PLc5MDeYsqNtku4vPwZz7rahA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/E5PLc5MDeYsqNtku4vPwZz7rahA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E5PLc5MDeYsqNtku4vPwZz7rahA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In the course of application development, certain components will often be reused. Creating and consuming reusable components should be included in the early design and architectural phases of software projects.
&lt;br /&gt;
&lt;br /&gt;Whether the reuse happens within the same application, or across different applications, it is often advantageous to package these reusable components into a library that can be shared between different teams.  These shared libraries can be added to a repository.  Later if you need a component,  you may look into the repository for something to be reused.
&lt;br /&gt;
&lt;br /&gt;Multiple Oracle ADF components are reusable, which include&lt;sup&gt;[1]&lt;/sup&gt;:
&lt;br /&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;Application modules&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Business Components&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Data controls&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Task flows&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Page templates&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;Declarative components&lt;/li&gt;&lt;/ul&gt;These reusable components can be packaged into the &lt;span style="font-weight: bold;"&gt;ADF Library &lt;/span&gt;for reuse in applications (see [4] for how-to).   Creating an ADF Library JAR involves compiling the project and  validating the components, creating a resource service file, control  files, an adflibREADME.txt, and adding the relevant project files into a  JAR.
&lt;br /&gt;
&lt;br /&gt;In this article, we will discuss a specific reusable component—&lt;span style="font-weight: bold;"&gt;Application Module&lt;/span&gt;.  Application modules are associated with &lt;span style="font-style: italic;"&gt;Business Components&lt;/span&gt;. When the  reusable application module was packaged, the JAR includes the Business  Components used to create the application module. These components will  be available for reuse.
&lt;br /&gt;
&lt;br /&gt;For packaging application modules, JDeveloper adds three control files to the JAR:
&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;oracle.adf.common.services.ResourceService.sva&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;Manifest.mf&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;adfm.xml&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;The service resource file for an application module includes entries   for the &lt;span style="font-style: italic;"&gt;Business Components&lt;/span&gt; associated with the application module, as   well as an entry for the application module data control.
&lt;br /&gt;
&lt;br /&gt;When you add an application module to a project, the application module appears in the &lt;span style="font-style: italic;"&gt;Data Controls&lt;/span&gt; panel.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;What's Application Module&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;Within a running BC4J application, one can think of the following containership of application objects:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Root Application Module contains nested Application Modules&lt;/li&gt;&lt;li&gt;An Application Module contains View Objects&lt;/li&gt;&lt;li&gt;A View Object contains Row Sets&lt;/li&gt;&lt;li&gt;A Row Set contain Row Set Iterators&lt;/li&gt;&lt;/ul&gt;Application Modules can be nested. That is, an Application Module can (logically) contain one or more other Application Modules (i.e., nested AMs) as well as View Objects.   The outermost containing Application Module is referred to as the "&lt;span style="font-weight: bold;"&gt;root&lt;/span&gt;" Application Module.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;What Do You Need to Know about Nested Application Module &lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;In this  &lt;span style="font-style: italic;"&gt;Andrejus Baranovskis&lt;/span&gt;' &lt;a href="http://andrejusb.blogspot.com/2010/06/adf-regions-and-nested-application.html"&gt;article&lt;/a&gt;, it has two application modules which contain View Objects created from &lt;span style="font-style: italic;"&gt;Employee &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;Job &lt;/span&gt;tables and are packaged into two ADF libraries
&lt;br /&gt;&lt;ol&gt;&lt;li style="font-weight: bold;"&gt;adflibEmplooyeesApp.jar&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;adflibJobsApp.jar&lt;/span&gt;
&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;These two libraries can be imported into an ADF web application in two ways:
&lt;br /&gt;&lt;ol&gt;&lt;li&gt; Integrating ADF JAR's directly into the &lt;span style="font-style: italic;"&gt;ViewController &lt;/span&gt;project (i.e.,  using  Application Modules directly from ADF JAR's)&lt;/li&gt;&lt;li&gt;Integrating ADF JAR's  into the &lt;span style="font-style: italic;"&gt;Model &lt;/span&gt;project with its own Application Module (i.e., Application Components from imported libraries are created as nested Application Modules)&lt;/li&gt;&lt;/ol&gt;Using either approach, you need to add both JAR's to the application first.  When you add an ADF Library JAR to a project, either by using the &lt;span style="font-style: italic;"&gt; Resource Palette &lt;/span&gt;or by manually adding the JAR, an ADF Library  definition is created in the project. The ADF Library JAR file will be  added to the &lt;span style="font-style: italic;"&gt;class path &lt;/span&gt;of the project. The project will access and  consume the components in the JAR by reference.  See &lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/reusing_components.htm#ADFFD21278"&gt;here &lt;/a&gt;for how to add an ADF Library JAR to a project using the &lt;span style="font-style: italic;"&gt;Resource Palette&lt;/span&gt;.
&lt;br /&gt;
&lt;br /&gt;In the first approach, two JAR's are added to the consuming project's (i.e., &lt;span style="font-style: italic;"&gt;ViewController&lt;/span&gt; project) class path   and so is available for reuse.   See &lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/reusing_components.htm#ADFFD21281"&gt;here &lt;/a&gt;on how to add them to the &lt;span style="font-style: italic;"&gt;ViewController &lt;/span&gt;project manually.  As shown below, &lt;span style="font-style: italic;"&gt;adflibEmployeesApp.jar &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;adflibJobsApp.jar &lt;/span&gt;are added to the &lt;span style="font-style: italic;"&gt;ViewController &lt;/span&gt;project's class path:
&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-NgFIyvKVJUw/TfoxKJ8Dy1I/AAAAAAAAAk4/-5j-TfmUAng/s1600/adflib.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 370px; height: 400px;" src="http://4.bp.blogspot.com/-NgFIyvKVJUw/TfoxKJ8Dy1I/AAAAAAAAAk4/-5j-TfmUAng/s400/adflib.JPG" alt="" id="BLOGGER_PHOTO_ID_5618857535634393938" border="0" /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);" class=" down" style="display: block;" id="formatbar_CreateLink" title="Link"&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Link" class="gl_link" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;In the second approach, you first create a new Application Module (i.e., &lt;span style="font-style: italic;"&gt;HrModule&lt;/span&gt;) in the Model project.  See &lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcservices.htm#insertedID2"&gt;here &lt;/a&gt;on how-to.  To specify a composite root application module that nests an instance of  an existing application module, you use the &lt;span style="font-style: italic;"&gt;overview &lt;/span&gt;editor for the  application module.  See &lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcservices.htm#ADFFD20426"&gt;here &lt;/a&gt;on how-to.
&lt;br /&gt;
&lt;br /&gt;As shown below, &lt;span style="font-style: italic;"&gt;EmpModule &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;JobsModule &lt;/span&gt;are nested under root Application Module &lt;span style="font-style: italic;"&gt;HrModule&lt;/span&gt; in the second approach:
&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-8Xe5yAOBn2c/Tfo_e5NvMeI/AAAAAAAAAlA/riNMj_Odnak/s1600/nestedAM.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 380px; height: 184px;" src="http://3.bp.blogspot.com/-8Xe5yAOBn2c/Tfo_e5NvMeI/AAAAAAAAAlA/riNMj_Odnak/s400/nestedAM.JPG" alt="" id="BLOGGER_PHOTO_ID_5618873285085180386" border="0" /&gt;&lt;/a&gt;Important notes about nested application modules:
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A nested Application Module design is useful for applications that  define several functional &lt;/li&gt;sub-applications that share the same  transaction context and transaction caches.
&lt;br /&gt;&lt;li&gt;With a nested Application Module design, it is easy to re-deploy nested Application Modules as standalone Application Modules in different client applications without having to modify the metadata for the other existing Application Module.&lt;/li&gt;&lt;li&gt;When a root application module contains other nested application   modules, they all participate in the root application module's&lt;span style="color: rgb(255, 102, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  transaction &lt;/span&gt;and share the same &lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;database connection&lt;/span&gt; &lt;/span&gt;and a single set of&lt;span style="color: rgb(255, 102, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  entity caches&lt;/span&gt;.&lt;ul&gt;&lt;li&gt;This sharing is handled for you automatically by the root application module and its "Transaction" object.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;A  nested Application Module cannot see the instances of any other   Application Modules that might be nested beneath the same root.&lt;/li&gt;&lt;li&gt;The API for application modules also supports nesting of application modules at runtime.&lt;/li&gt;&lt;li&gt;Nested Application Module can help performance by reducing database connection usage (i.e., sharing a single database connection instead of owning a separate connection per AM).
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Further Considerations&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You should consider how to organize and group the library JARs in a structure that fits your organizational needs.  For example,&lt;ul&gt;&lt;li&gt;Usually you want to have two separate application modules to support UIs and define services because&lt;ul&gt;&lt;li&gt;UI application modules may contain additional view objects and context values
&lt;br /&gt;that are only required for a particular UI, but not needed by a business service.&lt;/li&gt;&lt;li&gt;Application modules that define public services are versioned, but internal UI
&lt;br /&gt;application modules are not.
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;You should also consider creating standardized &lt;span style="font-weight: bold;"&gt;naming conventions &lt;/span&gt;so that both creators and consumers of ADF Library JARs can readily identify the component functionality.&lt;ul&gt;&lt;li&gt;You want to try to have unique names to avoid naming conflicts with other projects, components, or connections in the application. &lt;/li&gt;&lt;li&gt;Naming conflicts could arise from components created in the consuming application and those loaded from other JAR files.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;A project corresponds to one ADF Library JAR. &lt;ul&gt;&lt;li&gt;If you create multiple  projects and want to reuse components from each of the projects, you may  need to create an ADF Library JAR for each project.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;You can package multiple components into one JAR file, or you can  package a single component into a JAR file.&lt;ul&gt;&lt;li&gt;Oracle ADF and JDeveloper give you the option and flexibility to create reusable components that best suit you and your organization.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;You should avoid metadata naming conflicts between projects that will be combined at runtime.&lt;ul&gt;&lt;li&gt;The basic package naming requirement is that ADF metadata registries (.dcx,.cpx, and so on) are generated based on the project's package name.  So, make the package name unique.
&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;end&gt;
&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/reusing_components.htm#BEIGGIJC"&gt;Reusing Application Components&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcservices.htm#sm0229"&gt;Defining Nested Application Modules&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://jobinesh.blogspot.com/2010/03/what-you-may-need-to-know-about-nested.html"&gt;What you may need to know about Nested Application Module
&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/reusing_components.htm#BEIFEABF"&gt;How to Package a Component into an ADF Library JAR&lt;/a&gt;
&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/end&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-7316040042538211566?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/cE1YfGE3D28" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/7316040042538211566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=7316040042538211566" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/7316040042538211566?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/7316040042538211566?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/cE1YfGE3D28/reusable-adf-componentsapplication.html" title="Reusable ADF Components—Application Modules" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-NgFIyvKVJUw/TfoxKJ8Dy1I/AAAAAAAAAk4/-5j-TfmUAng/s72-c/adflib.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/06/reusable-adf-componentsapplication.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMEQHY4cCp7ImA9WhdRFEw.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-6888802632358929261</id><published>2011-05-29T13:52:00.000-07:00</published><updated>2011-08-03T16:33:21.838-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-03T16:33:21.838-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java Annotation Patterns Engine" /><category scheme="http://www.blogger.com/atom/ns#" term="JAPE Grammar" /><category scheme="http://www.blogger.com/atom/ns#" term="Transducer" /><category scheme="http://www.blogger.com/atom/ns#" term="Semantic Technologies" /><category scheme="http://www.blogger.com/atom/ns#" term="General Architecture for Text Engineering" /><category scheme="http://www.blogger.com/atom/ns#" term="JAPE" /><category scheme="http://www.blogger.com/atom/ns#" term="GATE" /><title>Java Annotation Patterns Engine (JAPE)</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0i90Q2yWBXgVtfL7REBUY7V1xqE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0i90Q2yWBXgVtfL7REBUY7V1xqE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0i90Q2yWBXgVtfL7REBUY7V1xqE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0i90Q2yWBXgVtfL7REBUY7V1xqE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In this article, we will introduce  the &lt;span style="font-weight: bold;"&gt;J&lt;/span&gt;ava &lt;span style="font-weight: bold;"&gt;A&lt;/span&gt;nnotation &lt;span style="font-weight: bold;"&gt;P&lt;/span&gt;atterns &lt;span style="font-weight: bold;"&gt;E&lt;/span&gt;ngine&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;(&lt;span style="color: rgb(255, 0, 0);"&gt;JAPE&lt;/span&gt;)&lt;span style="font-weight: bold;"&gt;, &lt;/span&gt;a component of the open-source &lt;span style="font-weight: bold;"&gt;G&lt;/span&gt;eneral &lt;span style="font-weight: bold;"&gt;A&lt;/span&gt;rchitecture for &lt;span style="font-weight: bold;"&gt;T&lt;/span&gt;ext &lt;span style="font-weight: bold;"&gt;E&lt;/span&gt;ngineering (&lt;span style="color: rgb(255, 0, 0);"&gt;GATE&lt;/span&gt;) platform.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Example of JAPE Grammar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;See below for an example of JAPE grammar (by convention, file type of &lt;span style="font-style: italic;"&gt;jape&lt;/span&gt;). And see the detailed descriptions of its components in later sections.  The context under which this grammar will be executed includes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;doc &lt;/span&gt;—Implements &lt;span style="font-style: italic;"&gt; gate.Document &lt;/span&gt;interface.  JAPE rules always work on an input annotation set associated with a specific document.&lt;/li&gt;&lt;li&gt; &lt;span style="font-weight: bold;"&gt;inputAS &lt;/span&gt;—Implements  &lt;span style="font-style: italic;"&gt;gate.AnnotationSet &lt;/span&gt;interface and represents the input annotation set.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;outputAS &lt;/span&gt;- Implements  &lt;span style="font-style: italic;"&gt;gate.AnnotationSet &lt;/span&gt;interface and represents the output annotation set.&lt;/li&gt;&lt;li&gt; &lt;span style="font-weight: bold;"&gt;ontology &lt;/span&gt;- Implements  &lt;span style="font-style: italic;"&gt;gate.creole.ontology.Ontology &lt;/span&gt;interface, which can be used in language analyzing. &lt;/li&gt;&lt;/ul&gt;&lt;pre&gt;// Valentin Tablan, 29/06/2001&lt;br /&gt;// $id$&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Phase:postprocess&lt;br /&gt;Input: Token SpaceToken&lt;br /&gt;Options: control = appelt debug = true&lt;br /&gt;&lt;br /&gt;// CR+LF | CR |LF+CR -&amp;gt; One single SpaceToken&lt;br /&gt;Rule: NewLine&lt;br /&gt;(&lt;br /&gt;({SpaceToken.string=="\n"}) |&lt;br /&gt;({SpaceToken.string=="\r"}) |&lt;br /&gt;({SpaceToken.string=="\n"}{SpaceToken.string=="\r"}) |&lt;br /&gt;({SpaceToken.string=="\r"}{SpaceToken.string=="\n"})&lt;br /&gt;):left&lt;br /&gt;--&amp;gt;&lt;br /&gt;{&lt;br /&gt;gate.AnnotationSet toRemove = (gate.AnnotationSet)bindings.get("left");&lt;br /&gt;outputAS.removeAll(toRemove);&lt;br /&gt;//get the tokens&lt;br /&gt;java.util.ArrayList tokens = new java.util.ArrayList(toRemove);&lt;br /&gt;//define a comparator for annotations by start offset&lt;br /&gt;Collections.sort(tokens, new gate.util.OffsetComparator());&lt;br /&gt;String text = "";&lt;br /&gt;Iterator tokIter = tokens.iterator();&lt;br /&gt;while(tokIter.hasNext())&lt;br /&gt;text += (String)((Annotation)tokIter.next()).getFeatures().get("string");&lt;br /&gt;&lt;br /&gt;gate.FeatureMap features = Factory.newFeatureMap();&lt;br /&gt;features.put("kind", "control");&lt;br /&gt;features.put("string", text);&lt;br /&gt;features.put("length", Integer.toString(text.length()));&lt;br /&gt;outputAS.add(toRemove.firstNode(), toRemove.lastNode(), "SpaceToken", features);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;What's JAPE?&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;JAPE is a &lt;span style="font-style: italic;"&gt;finite state transducer  &lt;/span&gt;that operates over annotations based on regular expressions. Thus it is  useful for pattern-matching, semantic extraction, and many other  operations over syntactic trees such as those produced by natural  language parsers.&lt;br /&gt;&lt;br /&gt;A JAPE grammar consists of a set of &lt;span style="font-weight: bold;"&gt;phases&lt;/span&gt;, each of which consists of  a set of pattern/action rules. The phases run sequentially and  constitute a cascade of finite state transducers over annotations.  One of the main reasons for using a sequence of phases is that a pattern can only be used once in each phase, but it can be reused in a later phase.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Input annotations &lt;/span&gt;could be specified at the beginning of the grammar.   This specifies what types of annotations will be processed by the rules of grammar.    Other not-mentioned types will be ignored.  By default the transducer will include &lt;span style="font-style: italic;"&gt;Token&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;SpaceToken &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;Lookup&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;Options &lt;/span&gt;specification defines the method of rule matching (i.e., &lt;span style="font-style: italic;"&gt;control&lt;/span&gt;) and debug flag for the rules (i.e., &lt;span style="font-style: italic;"&gt;debug&lt;/span&gt;) in the grammar.  There are five &lt;span style="font-style: italic;"&gt;control styles&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;brill&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;— When more than one rule matches the same region of the document, they all are fired.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;all&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;— Similar to &lt;span style="font-style: italic;"&gt;brill&lt;/span&gt;, in that it will also execute all matching rules, but the matching will continue from the next offset to the current one.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;first&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;— With the &lt;span style="font-style: italic;"&gt;first &lt;/span&gt;style, a rule fires for the first match that‘s found.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;once&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;— Once a rule has fired, the whole JAPE phase exits after the first match.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;appelt &lt;/span&gt;—  Only one rule can be fired for the same region of text, according to a set of priority rules. The &lt;span style="font-style: italic;"&gt;appelt &lt;/span&gt;control style is the most appropriate for named entity recognition as under &lt;span style="font-style: italic;"&gt;appelt &lt;/span&gt;only one rule can fire for the same pattern.&lt;/li&gt;&lt;/ul&gt; If &lt;span style="font-style: italic;"&gt;debug &lt;/span&gt;is set to true, any rule-firing conflicts will be displayed in the messages window if the grammar is running in &lt;span style="font-style: italic;"&gt;appelt &lt;/span&gt;mode and there is more than one possible match.&lt;br /&gt;&lt;br /&gt;Following the declaration portions of grammar,  a list of rules are specified.  Each rule consists of a left-hand-side (&lt;span style="font-weight: bold;"&gt;LHS&lt;/span&gt;) and a right-hand-side (&lt;span style="font-weight: bold;"&gt;RHS&lt;/span&gt;).  The LHS of the rules consists of an annotation pattern  description. The RHS consists of annotation  manipulation statements. Annotations matched on the LHS of a rule may be  referred to on the RHS by means of labels that are attached to pattern  elements.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;LHS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;LHS contains annotation pattern that may contain regular expression operators e.g. ("+", "?" , "*").  However, you should avoid the use of “*” based regular expressions for better performance.&lt;br /&gt;&lt;br /&gt;There are 3 main ways in which the pattern can be specified:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;As a string of text&lt;ul&gt;&lt;li&gt;e.g., &lt;span style="font-style: italic;"&gt;{Token.string == "Oracle"}&lt;/span&gt;&lt;/li&gt;&lt;li&gt;This pattern matches a string of text with the value of "Oracle".&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;As the attributes (and values) of an annotation&lt;ul&gt;&lt;li&gt;e.g., &lt;span style="font-style: italic;"&gt;({Token.kind == word, Token.category == NNP, Token.orth == upperInitial})?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;The above pattern uses the Part of Speech (POS) annotation where kind=word, category=NNP and orth=upperInitial.&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;As an annotation previously assigned from a &lt;span style="font-style: italic;"&gt;gazetteer&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;tokeniser&lt;/span&gt;, or other module&lt;ul&gt;&lt;li&gt;({Company})?:c1 ({Positives}):v ({Company})?:c2 ({Split}|{CC})?&lt;/li&gt;&lt;li&gt;The above pattern matches annotations of &lt;span style="font-style: italic;"&gt;Company &lt;/span&gt;type,  followed by annotations of &lt;span style="font-style: italic;"&gt;Positives &lt;/span&gt;type, etc.  The first-matched pattern element is labeled as &lt;span style="font-style: italic;"&gt;c1&lt;/span&gt;, the second-matched pattern element is labeled as &lt;span style="font-style: italic;"&gt;v&lt;/span&gt;, etc.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;There are different kind of operators supported:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Equality operators &lt;/span&gt;(“==” and “!=”)&lt;ul&gt;&lt;li&gt;{Token.kind == "number"}, {Token.length != 4}&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Comparison operators &lt;/span&gt;(“&amp;lt;”, “&amp;lt;=”, “&amp;gt;=” and “&amp;gt;”) &lt;ul&gt;&lt;li&gt;{Token.string &amp;gt; "aardvark"}, {Token.length &amp;lt; 10}&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Regular expression operators &lt;/span&gt;(“=~”, “==~”, “!~” and “!=~”)&lt;ul&gt;&lt;li&gt;{Token.string =~ "[Dd]ogs"}, {Token.string !~ "(?i)hello"}&lt;/li&gt;&lt;li&gt;==~ and !=~ are also provided, for whole-string matching&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;{X contains Y} and {X within Y} for checking annotations within the context of other annotations&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/div&gt;You can even define custom operators by  implementing &lt;span style="font-style: italic;"&gt;gate.jape.constraint.ConstraintPredicate&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;RHS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The right-hand-side (&lt;span style="font-weight: bold;"&gt;RHS&lt;/span&gt;)  consists of annotation  manipulation statements.  For example, you can add/remove/update annotations associated with a document.  Alternatively, RHS can contain Java code to create or manipulate annotations.  In this article, we will focus only on RHS' implemented in Java code.&lt;br /&gt;&lt;br /&gt;On the RHS, Java code can reference the following variables (which are passed as parameters to the RHS action):&lt;br /&gt;&lt;ul&gt;&lt;li style="font-weight: bold;"&gt;doc&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;bindings&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;annotations&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;inputAS&lt;/li&gt;&lt;li style="font-weight: bold;"&gt;outputAS&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;ontology&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style: italic;"&gt;annotations &lt;/span&gt;is provided for backward compatibility and should not be used for new implementations.  &lt;span style="font-style: italic;"&gt;inputAS &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;outputAS &lt;/span&gt;represent the input and output annotation set.  Normally, these would be the same (by default when using ANNIE, these  will be the “Default” annotation set) .  However, the user is at liberty to  change the input and output annotation sets in the parameters of the  JAPE transducer at runtime.  Therefore, it cannot be guaranteed that the input and  output annotation sets will be the same, and we should specify  the annotation set we are referring to.&lt;br /&gt;&lt;br /&gt;Annotations matched on  the LHS of a rule may be  referred to on the RHS by means of labels that  are attached to pattern  elements.  They can be retrieved by using &lt;span style="font-style: italic;"&gt;bindings &lt;/span&gt;as follows:&lt;br /&gt;&lt;pre&gt;gate.AnnotationSet toRemove = (gate.AnnotationSet)bindings.get("c1");&lt;/pre&gt;This returns a temporary annotation set which holds all the annotations matched on the LHS that have been labeled as "c1."&lt;br /&gt;&lt;br /&gt;In the following discussions, we assume you use ANNIE and both &lt;span style="font-style: italic;"&gt;inputAS &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;outputAS &lt;/span&gt;points to the same annotation set.&lt;br /&gt;&lt;br /&gt;On the RHS, you can do any of the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Remove annotations from document's annotation set(s)&lt;/li&gt;&lt;li&gt;Update annotations in document's annotation set(s)&lt;/li&gt;&lt;li&gt;Add new annotations to document's annotation set(s)&lt;/li&gt;&lt;/ul&gt;However, if you try to remove annotations while using the same iterator for other tasks at the same time, you may see:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; &lt;span style="font-style: italic;"&gt;java.util.ConcurrentModificationException&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;The solution is to collect all to-be-removed annotations on a list and process them at the end.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;RhsAction&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To understand the RHS action, you need to know how a JAPE rule is translated to its executable binary in Java.  For example, rule &lt;span style="font-style: italic;"&gt;ConjunctionIdentifier2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Rule: ConjunctionIdentifier2&lt;br /&gt;(&lt;br /&gt;({Token.category=="CC"}):conj2&lt;br /&gt;)&lt;br /&gt;--&amp;gt;&lt;br /&gt;:conj2&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;gate.AnnotationSet matchedAnns= (gate.AnnotationSet) bindings.get("conj2");&lt;br /&gt;gate.FeatureMap newFeatures= Factory.newFeatureMap();&lt;br /&gt;newFeatures.put("rule","ConjunctionIdentifierr21");&lt;br /&gt;outputAS.add(matchedAnns.firstNode(),matchedAnns.lastNode(),"CC", newFeatures);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;will be translated into:&lt;br /&gt;&lt;pre&gt;1  // ConjunctionIdentifierConjunctionIdentifier2ActionClass14&lt;br /&gt;2  package japeactionclasses;&lt;br /&gt;3  import java.io.*;&lt;br /&gt;4  import java.util.*;&lt;br /&gt;5  import gate.*;&lt;br /&gt;6  import gate.jape.*;&lt;br /&gt;7  import gate.creole.ontology.*;&lt;br /&gt;8  import gate.annotation.*;&lt;br /&gt;9  import gate.util.*;&lt;br /&gt;10&lt;br /&gt;11  public class ConjunctionIdentifierConjunctionIdentifier2ActionClass14&lt;br /&gt;12  implements java.io.Serializable, RhsAction {&lt;br /&gt;13    public void doit(gate.Document doc,&lt;br /&gt;14                     java.util.Map&lt;java.lang.string, annotationset=""&gt; bindings,&lt;br /&gt;15                     gate.AnnotationSet annotations,&lt;br /&gt;16                     gate.AnnotationSet inputAS, gate.AnnotationSet outputAS,&lt;br /&gt;17                     gate.creole.ontology.Ontology ontology) throws gate.jape.JapeException {&lt;br /&gt;18      gate.AnnotationSet conj2Annots = bindings.get("conj2");&lt;br /&gt;19      if(conj2Annots != null &amp;amp;&amp;amp; conj2Annots.size() != 0) {&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22      gate.AnnotationSet matchedAnns= (gate.AnnotationSet) bindings.get("conj2");&lt;br /&gt;23      gate.FeatureMap newFeatures= Factory.newFeatureMap();&lt;br /&gt;24      newFeatures.put.("rule","ConjunctionIdentifierr21");&lt;br /&gt;25      outputAS.add(matchedAnns.firstNode(),matchedAnns.lastNode(),"CC", newFeatures);&lt;br /&gt;26&lt;br /&gt;27      }&lt;br /&gt;28    }&lt;br /&gt;29  }&lt;br /&gt;&lt;/java.lang.string,&gt;&lt;/pre&gt;&lt;br /&gt;Notice that RHS of the rule is wrapped into &lt;span style="font-style: italic;"&gt;doit &lt;/span&gt;method which has the following signature:&lt;br /&gt;&lt;pre&gt;public void doit(gate.Document doc,&lt;br /&gt;java.util.Map&lt;java.lang.string, annotationset=""&gt; bindings,&lt;br /&gt;gate.AnnotationSet annotations,&lt;br /&gt;gate.AnnotationSet inputAS, gate.AnnotationSet outputAS,&lt;br /&gt;gate.creole.ontology.Ontology ontology)&lt;br /&gt;&lt;/java.lang.string,&gt;&lt;/pre&gt;&lt;br /&gt;That's why you can reference:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;doc&lt;/li&gt;&lt;li&gt;bindings&lt;/li&gt;&lt;li&gt;annotations&lt;/li&gt;&lt;li&gt;inputAS&lt;/li&gt;&lt;li&gt;outputAS&lt;/li&gt;&lt;li&gt;ontology&lt;/li&gt;&lt;/ul&gt;without declaring them.&lt;br /&gt;&lt;br /&gt;Also notice that the return type of &lt;span style="font-style: italic;"&gt;doit &lt;/span&gt;method is &lt;span style="font-style: italic;"&gt;void&lt;/span&gt;.  It means that you can exit from the middle of action execution by issuing a &lt;code&gt;return&lt;/code&gt; statement:&lt;br /&gt;&lt;pre&gt;if (annotation.getFeatures().get("tagged") != null)&lt;br /&gt;return;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/JAPE_%28linguistics%29"&gt;JAPE (linguistics)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://gate.ac.uk/sale/thakker-jape-tutorial/GATE%20JAPE%20manual.pdf"&gt;GATE JAPE Grammar Tutorial&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://gate.ac.uk/sale/tao/index.html#x1-2090008"&gt;JAPE: Regular Expressions over Annotations&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-6888802632358929261?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/lzkAB3xy1o0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/6888802632358929261/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=6888802632358929261" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/6888802632358929261?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/6888802632358929261?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/lzkAB3xy1o0/java-annotation-patterns-engine-jape.html" title="Java Annotation Patterns Engine (JAPE)" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>1</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/05/java-annotation-patterns-engine-jape.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IGR347cCp7ImA9WhRTFUQ.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-1130373404609328568</id><published>2011-05-25T11:21:00.000-07:00</published><updated>2011-11-06T09:12:06.008-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-06T09:12:06.008-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GATE Embedded" /><category scheme="http://www.blogger.com/atom/ns#" term="System Properties" /><category scheme="http://www.blogger.com/atom/ns#" term="Semantic Technologies" /><category scheme="http://www.blogger.com/atom/ns#" term="Java Classloading" /><category scheme="http://www.blogger.com/atom/ns#" term="General Architecture for Text Engineering" /><category scheme="http://www.blogger.com/atom/ns#" term="GATE" /><title>Cannot get GATE Home. Pease set it manually!</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/R5SD_e-lzpWbQmMQFKEPP9QjSec/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/R5SD_e-lzpWbQmMQFKEPP9QjSec/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/R5SD_e-lzpWbQmMQFKEPP9QjSec/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/R5SD_e-lzpWbQmMQFKEPP9QjSec/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;When you run your application using &lt;a href="http://gate.ac.uk/sale/tao/splitch7.html#chap:api"&gt;GATE Embedded&lt;/a&gt;, you often run into an error:&lt;br /&gt;&lt;ul style="font-style: italic;"&gt;&lt;li&gt;Cannot get GATE Home. Pease set it manually!&lt;/li&gt;&lt;/ul&gt;This means that you need to set &lt;span style="font-weight: bold;"&gt;gate.home &lt;/span&gt;property before calling &lt;span style="font-style: italic;"&gt;Gate.init()&lt;/span&gt;.  You can do that in two ways:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In your Java code&lt;ul&gt;&lt;li&gt;Gate.setGateHome(File)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;In the Java command that launches your program&lt;/li&gt;&lt;ul&gt;&lt;li&gt;-Dgate.home=path/to/gate/home&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;GATE also needs to initialize the paths to local files of interest like:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Installed plugins home&lt;/li&gt;&lt;li&gt;Site configuration file&lt;/li&gt;&lt;li&gt;User configuration file&lt;/li&gt;&lt;/ul&gt;if these are not at their default locations.  To help configure these paths, you can use the following &lt;a href="http://gate.ac.uk/sale/tao/splitch2.html#sec:gettingstarted:sysprop"&gt;system properties&lt;/a&gt;:&lt;br /&gt;&lt;dl class="description"&gt;&lt;dt style="font-weight: bold;" class="description"&gt; &lt;span class="cmbx-12"&gt;gate.home&lt;/span&gt; &lt;/dt&gt;&lt;dd class="description"&gt;sets the location of the GATE install directory. This should point to the top       level directory of your GATE installation. This is the only property that is required.       If this is not set, the system will display an error message and them it will attempt to       guess the correct value.       &lt;/dd&gt;&lt;dt style="font-weight: bold;" class="description"&gt; &lt;span class="cmbx-12"&gt;gate.plugins.home&lt;/span&gt; &lt;/dt&gt;&lt;dd class="description"&gt;points  to  the  location  of  the  directory  containing  installed  plugins       (a.k.a.   CREOLE   directories).   If   this   is   not   set   then   the   default   value   of       &lt;span class="cmsy-10x-x-120"&gt;{&lt;/span&gt;&lt;span class="cmtt-12"&gt;gate.home&lt;/span&gt;&lt;span class="cmsy-10x-x-120"&gt;}&lt;/span&gt;&lt;span class="cmtt-12"&gt;/plugins &lt;/span&gt;is used.       &lt;/dd&gt;&lt;dt style="font-weight: bold;" class="description"&gt; &lt;span class="cmbx-12"&gt;gate.site.conﬁg&lt;/span&gt; &lt;/dt&gt;&lt;dd class="description"&gt;points to the location of the conﬁguration ﬁle containing the site-wide       options. If not set this will default to &lt;span class="cmsy-10x-x-120"&gt;{&lt;/span&gt;&lt;span class="cmtt-12"&gt;gate.home&lt;/span&gt;&lt;span class="cmsy-10x-x-120"&gt;}&lt;/span&gt;&lt;span class="cmtt-12"&gt;/gate.xml&lt;/span&gt;. The site conﬁguration       ﬁle must exist!       &lt;/dd&gt;&lt;dt style="font-weight: bold;" class="description"&gt; &lt;span class="cmbx-12"&gt;gate.user.conﬁg&lt;/span&gt; &lt;/dt&gt;&lt;dd class="description"&gt;points to the ﬁle containing the user’s options. If not speciﬁed, or if the       speciﬁed ﬁle does not exist at startup time, the default value of gate.xml (.gate.xml on       Unix platforms) in the user’s home directory is used.       &lt;/dd&gt;&lt;dt style="font-weight: bold;" class="description"&gt; &lt;span class="cmbx-12"&gt;load.plugin.path&lt;/span&gt; &lt;/dt&gt;&lt;dd class="description"&gt;is a path-like structure, i.e. a list of URLs separated by ‘;’. All directories       listed here will be loaded as CREOLE plugins during initialisation. This has similar       functionality with the the &lt;span class="cmtt-12"&gt;-d &lt;/span&gt;command line option.       &lt;/dd&gt;&lt;dt style="font-weight: bold;" class="description"&gt; &lt;span class="cmbx-12"&gt;gate.builtin.creole.dir&lt;/span&gt; &lt;/dt&gt;&lt;dd class="description"&gt;is a URL pointing to the location of GATE’s built-in CREOLE       directory. This is the location of the &lt;span class="cmtt-12"&gt;creole.xml &lt;/span&gt;ﬁle that deﬁnes the fundamental       GATE resource types, such as documents, document format handlers, controllers and       the basic visual resources that make up GATE. The default points to a location inside       &lt;span class="cmtt-12"&gt;gate.jar &lt;/span&gt;and should not generally need to be overridden.&lt;/dd&gt;&lt;/dl&gt;As described above, the only property that is required is &lt;span style="font-style: italic;"&gt;gate.home &lt;/span&gt;if you lay out other resources at their default locations.&lt;br /&gt;&lt;br /&gt;In this article, we will show you one way to run your GATE application in &lt;span style="font-style: italic;"&gt;Oracle WebLogic Server&lt;/span&gt; (&lt;span style="font-weight: bold;"&gt;WLS&lt;/span&gt;).  This allows you to test your deployed application quickly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Classloading in Java Platform and Oracle WebLogic Server&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the application you are creating has dependencies on some third-party code (for example, gate.jar), what is the proper way to package these libraries so that they can be used by a portable J2EE application?&lt;br /&gt;&lt;br /&gt;In the J2EE platform, there are mechanisms&lt;sup&gt;[4]&lt;/sup&gt; available for including libraries in a portable application:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The WEB-INF/lib Directory&lt;/li&gt;&lt;li&gt;Bundled Optional Classes&lt;/li&gt;&lt;li&gt;Installed Packages (or installed optional packages mechanism)&lt;/li&gt;&lt;/ol&gt;Since these mechanisms are well-documented, they will not be repeated here.&lt;br /&gt;&lt;br /&gt;To use these third-party libraries along  with your application code, you face the decision of which packaging mechanism to choose. The decision you make can have major effects  on the following: &lt;ul&gt;&lt;li&gt;The portability of your application&lt;/li&gt;&lt;li&gt;The size of your WAR and EAR files&lt;/li&gt;&lt;li&gt;The maintenance of the application&lt;/li&gt;&lt;li&gt;Version control as libraries and application servers are updated&lt;/li&gt;&lt;/ul&gt;Some solutions for packaging library JAR files are specific to a  particular application server: for example, placing a library JAR file  in an application server's classpath so that applications can use the  APIs in that JAR file. Some application servers have container-specific  locations where you can place JAR files to be shared by applications and  modules. But these mechanisms are not portable, unlike the mechanisms  provided by the J2EE platform.&lt;br /&gt;&lt;br /&gt;In this article, we will introduce one WLS-specific mechanism to use for the GATE installation. This will allow you to quick-test your GATE application.&lt;br /&gt;&lt;br /&gt;In WLS, you can place JAR files to be shared by applications and  modules at the following location:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;$DOMAIN_DIR/lib&lt;/li&gt;&lt;/ul&gt;This is the &lt;span style="font-weight: bold;"&gt;domain library directory&lt;/span&gt;.  The domain library directory is  one  mechanism that can be used for adding application libraries to the   server classpath.   The   jars located in this directory will be picked up and added dynamically   to the end of the server classpath at server startup. The jars will be   ordered lexically in the classpath. &lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;It  is possible to override the $DOMAIN_DIR/lib directory using the  &lt;code&gt;-Dweblogic.ext.dirs&lt;/code&gt; system property during startup. This property  specifies a list of directories to pick up jars from and dynamically  append to the end of the server classpath using &lt;span style="font-style: italic;"&gt; java.io.File.pathSeparator &lt;/span&gt;as the delimiter between path entries.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Default GATE Installation Layout&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;br /&gt;The GATE architecture is based on components.  Each component (i.e., a Java Beans), is a reusable chunks of software  with well-defined interfaces that may be deployed in a variety of  contexts.&lt;br /&gt;&lt;br /&gt;You can define applications with processing pipelines using  these reusable components. In GATE, these resources are officially named  &lt;strong&gt;CREOLE&lt;/strong&gt; (i.e., &lt;strong&gt;C&lt;/strong&gt;ollection of &lt;strong&gt;RE&lt;/strong&gt;usable &lt;strong&gt;O&lt;/strong&gt;bjects for &lt;strong&gt;L&lt;/strong&gt;anguage &lt;strong&gt;E&lt;/strong&gt;ngineering).  You can read this &lt;a href="http://xmlandmore.blogspot.com/2011/03/gate-plugins-and-creole-resources.html"&gt;article &lt;/a&gt;to understand how GATE plugins and CREOLE resources are configured.&lt;br /&gt;&lt;br /&gt;In the following, we show how GATE's resources are laid out in the WLS' domain library directory:&lt;pre&gt;/wls_domain/lib/gatehome (i.e., GATE's home directory)&lt;br /&gt;+-- lib/&lt;br /&gt;+-- Bib2HTML.jar&lt;br /&gt;+-- GnuGetOpt.jar&lt;br /&gt;+-- ...&lt;br /&gt;+-- plugins/&lt;br /&gt;+-- ANNIE/&lt;br /&gt;  +-- ANNIE_with_defaults.gapp&lt;br /&gt;  +-- build.xml&lt;br /&gt;  +-- creole.xml&lt;br /&gt;  +-- resources/&lt;br /&gt;+-- Tools/&lt;br /&gt;  +-- build.xml&lt;br /&gt;  +-- creole.xml&lt;br /&gt;  +-- doc/&lt;br /&gt;  +-- resources/&lt;br /&gt;  +-- src/&lt;br /&gt;  +-- tools.jar&lt;br /&gt;+-- gate .xml&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;&lt;a name="mechs"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/h3&gt;After you've installed GATE's libraries and resources in the domain library directory.  The next step you need to do is setting &lt;span style="font-style: italic;"&gt;gate.home &lt;/span&gt;property in &lt;span style="font-style: italic;"&gt;wls_domain/bin/setDomainEnv.sh&lt;/span&gt;:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;EXTRA_JAVA_PROPERTIES=" ${EXTRA_JAVA_PROPERTIES} -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dgate.home=${DOMAIN_HOME}/lib/gatehome"&lt;br /&gt;export EXTRA_JAVA_PROPERTIES&lt;/code&gt;&lt;div&gt;&lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Final Words&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As mentioned before, this is not the best way to configure GATE's installation in a WLS.  However, this approach will allow you to test your deployed GATE application quickly on it.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-style: italic;"&gt;domain library directory &lt;/span&gt;in WLS is  intended for JAR files that change infrequently and are required by all  or most applications deployed in the server, or by WebLogic Server  itself. For example, you might use the &lt;code class="cCode"&gt;lib&lt;/code&gt;  directory to store third-party utility classes that are required by all  deployments in a domain. You can also use it to apply patches to  WebLogic Server.   &lt;p class="pBody"&gt;&lt;a name="wp1096773"&gt; &lt;/a&gt; The &lt;span style="font-style: italic;"&gt;domain library directory &lt;/span&gt;is not recommended as a  general-purpose method for sharing a JARs between one or two  applications deployed in a domain, or for sharing JARs that need to be  updated periodically. If you update a JAR in the &lt;code class="cCode"&gt;lib&lt;/code&gt;  directory, you must reboot all servers in the domain in order for  applications to realize the change. If you need to share a JAR file or  Java EE modules among several applications, use the Java EE libraries  feature &lt;a href="http://download.oracle.com/docs/cd/E12840_01/wls/docs103/programming/libraries.html"&gt;here&lt;/a&gt;.  Alternatively, you can write custom class loaders to better fit your application's needs.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://java.sun.com/j2ee/verified/packaging.html"&gt;Packaging Utility Classes or Library JAR Files in a Portable J2EE Application&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm"&gt;Understanding WebLogic Server Application Classloading&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#i1097192"&gt;Overview of WebLogic Server Application Classloading&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.sun.com/j2ee/verified/packaging.html#mechs"&gt;Mechanisms for Using Libraries in J2EE Applications&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://hudson.gate.ac.uk/job/GATE-Nightly/javadoc/gate/Gate.html"&gt;Class Gate&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://gate.ac.uk/sale/tao/splitch7.html#chap:api"&gt;GATE Embedded&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://gate.ac.uk/sale/tao/splitch2.html#sec:gettingstarted:sysprop"&gt;Using System Properties with GATE&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/03/gate-plugins-and-creole-resources.html"&gt;GATE Plugins and CREOLE Resources&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-1130373404609328568?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/KZ8jHMMH9uU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/1130373404609328568/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=1130373404609328568" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/1130373404609328568?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/1130373404609328568?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/KZ8jHMMH9uU/cannot-get-gate-home-pease-set-it.html" title="Cannot get GATE Home. Pease set it manually!" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/05/cannot-get-gate-home-pease-set-it.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEINRX4-eip7ImA9WhdTFks.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-6416673769929053996</id><published>2011-05-24T14:52:00.000-07:00</published><updated>2011-07-14T09:56:34.052-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-14T09:56:34.052-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JDBC DataSource" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle WebLogic Server" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle JDeveloper 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="Database Connection" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle ADF 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="JDBC URL" /><title>Configuring JDBC Data Sources in JDeveloper and Oracle WebLogic Server</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IWXIh1nJvD2TCkJMpEVOhZmVhDc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IWXIh1nJvD2TCkJMpEVOhZmVhDc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IWXIh1nJvD2TCkJMpEVOhZmVhDc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IWXIh1nJvD2TCkJMpEVOhZmVhDc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In a previous &lt;a href="http://xmlandmore.blogspot.com/2010/03/database-connections-in-jdeveloper-11.html"&gt;article&lt;/a&gt;, we have introduced different ways of creating and managing database connections in JDeveloper.  Those connections (i.e. using JDBC URL) are good for the testing of &lt;span style="font-style: italic;"&gt;JDeveloper Design-time&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;Business Components Tester&lt;/span&gt;, and &lt;span style="font-style: italic;"&gt;Integrated WebLogic Server&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In the production environment, the web application would typically reference a JDBC datasource,  since it simplifies maintenance of the connection credentials by  allowing them to be centrally managed in the Java EE container.   In this article, we will show you how to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Switch from JDBC URL to JDBC DataSource in JDeveloper.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Setup global JDBC DataSource for database connection in the WebLogic Server&lt;/li&gt;&lt;li&gt;Deploy a Web Application to the WebLogic Server&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;JDBC URL vs. JDBC DataSource&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you use &lt;span style="font-style: italic;"&gt;JDBC URL &lt;/span&gt;connection type, you provide settings as shown below:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-tu_COIPcrNQ/TdxOtA1j36I/AAAAAAAAAkU/geI-TOSN9hs/s1600/JDBC_URL.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://2.bp.blogspot.com/-tu_COIPcrNQ/TdxOtA1j36I/AAAAAAAAAkU/geI-TOSN9hs/s400/JDBC_URL.JPG" alt="" id="BLOGGER_PHOTO_ID_5610445771022524322" border="0" /&gt;&lt;/a&gt;However, if you use &lt;span style="font-style: italic;"&gt;JDBC DataSource &lt;/span&gt;connection type, its settings are done on the server.  To avoid passwords being present in plain text in deployed files, JDeveloper uses password indirection, which means that passwords for the data sources must be set on the server before the application will run correctly.&lt;br /&gt;&lt;br /&gt;A data source object enables a Java Database Connectivity (JDBC) client to obtain a DBMS connection from a JDBC pool.   A data source is a vendor-independent encapsulation of a database server connection. The data source offers advantages over a JDBC URL connection because the data source can be tuned, reconfigured, or remapped without changing the deployed application.&lt;br /&gt;&lt;br /&gt;In WebLogic Server, you configure database connectivity by adding data sources  to your WebLogic domain. WebLogic JDBC data sources provide database access and  database connection management. Each data source contains a pool of database  connections that are created when the data source is created and at server  startup.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Choosing JDBC DataSource &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After you finish testing your application using &lt;span style="font-style: italic;"&gt;Integrated WebLogic Server &lt;/span&gt;and decide to deploy it to a standalone WebLogic Server, then it's time to configure &lt;span style="font-style: italic;"&gt;JDBC DataSource &lt;/span&gt;as your application's connection type.&lt;br /&gt;&lt;br /&gt;This configuration step is done on the Application Module in the Business Layer.&lt;br /&gt;&lt;a style="font-style: italic;" href="http://2.bp.blogspot.com/-OZz5lc76j2Y/TdxWpQPyItI/AAAAAAAAAkc/hqDWYq57ZCc/s1600/JDBC_DataSource.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 147px;" src="http://2.bp.blogspot.com/-OZz5lc76j2Y/TdxWpQPyItI/AAAAAAAAAkc/hqDWYq57ZCc/s400/JDBC_DataSource.JPG" alt="" id="BLOGGER_PHOTO_ID_5610454502532588242" border="0" /&gt;&lt;/a&gt;&lt;span style="font-style: italic;"&gt;Edit Business Components Configuration &lt;/span&gt;dialog is used  to create a new application module configuration or edit an existing one.   To open it, do:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Application Navigator context menu for application modules &amp;gt; Configurations &amp;gt; Edit &amp;gt; Application Module tab&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You choose to connect to a JDBC DataSource from the dropdown list.  The JDeveloper helps create the data source name based on available resource connections.    This data source naming convention follows the Java EE standard which specifies that resource connections appear in the application-specific name space &lt;span style="font-style: italic;"&gt;java:comp/env/jdbc/&lt;/span&gt;.  For example, for a connection named 'SmmApp', the JDBC Datasource name would be 'java:comp/env/jdbc/SmmAppDS'.&lt;br /&gt;&lt;br /&gt;When you deploy the application and run it in standalone Oracle WebLogic Server, the specified data source connection in the application module configuration will be used.&lt;br /&gt;&lt;h3&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Setting up Global JDBC DataSource &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;font-size:100%;" &gt;You can create a global data source on Oracle WebLogic Server Administration Console:&lt;/span&gt;&lt;br /&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;http://xbox.mycompany.com:7001/console/&lt;/li&gt;&lt;/ul&gt;  &lt;span style="border-collapse: separate; color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family:Tahoma;font-size:medium;"  &gt;&lt;/span&gt;To set up a global data source:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Login to the Oracle WebLogic Server Administration Console. Click  on the &lt;span style="font-style: italic;"&gt;Data Sources&lt;/span&gt; link under &lt;span style="font-style: italic;"&gt;JDBC&lt;/span&gt;. On the Summary of JDBC Data Sources  page, click &lt;span style="font-style: italic;"&gt;New&lt;/span&gt;. In the &lt;span style="font-style: italic;"&gt;Create a New JDBC Data Source&lt;/span&gt; page, enter  details of the data source.&lt;/li&gt;&lt;li&gt;The name can be anything.&lt;/li&gt;&lt;li&gt;The JNDI name must be of the form &lt;span style="font-style: italic;"&gt;jdbc/connection-nameDS&lt;/span&gt;. For  example, if the application has a connection name &lt;span style="font-style: italic;"&gt;SmmApp&lt;/span&gt;, the JNDI  name is&lt;span style="font-style: italic;"&gt; jdbc/SmmAppDS&lt;/span&gt;. Ensure that the database type is &lt;span style="font-style: italic;"&gt;Oracle &lt;/span&gt;and  that the driver is Oracle’s Driver (Thin) for Service  Connections;Version 9.0.1,9.2.0,10,11. Click &lt;span style="font-style: italic;"&gt;Next &lt;/span&gt;twice to navigate to  the &lt;span style="font-style: italic;"&gt;Create a New JDBC Data Source&lt;/span&gt; page, where you enter the connection  details.&lt;/li&gt;&lt;li&gt;The database name is the Oracle SID.&lt;/li&gt;&lt;li&gt;The host name is the the name of the machine the database is on.&lt;/li&gt;&lt;li&gt;The default port is 1521.&lt;/li&gt;&lt;li&gt;Enter the user name and password, for example hr/hr. Click &lt;span style="font-style: italic;"&gt;Next  &lt;/span&gt;and click Test Configuration. Click &lt;span style="font-style: italic;"&gt;Next &lt;/span&gt;to navigate to the &lt;span style="font-style: italic;"&gt;Select  Targets &lt;/span&gt;page, where you select a target for this data source. If you  fail to select a target, the data source is created but not deployed.  Click &lt;span style="font-style: italic;"&gt;Finish&lt;/span&gt;.   &lt;/li&gt;&lt;/ol&gt; &lt;h3&gt;Steps to Deploy to WebLogic Server&lt;/h3&gt;&lt;span style="font-style: italic;"&gt;Application Properties Dialog &lt;/span&gt;is used to to define the deployment profiles that will be available to an application.  To open &lt;span style="font-style: italic;"&gt;Deployment &lt;/span&gt;page, do:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Application menu &amp;gt; Application Properties &amp;gt; Deployment page&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Makre sure "&lt;span style="font-style: italic;"&gt;Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment&lt;/span&gt;" is unchecked.  When this field is not selected, this means that your deployed application will use global data sources on the server.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-1rM5_OJutDI/Tdxnb5AAv6I/AAAAAAAAAkk/wuhiLT3MBBY/s1600/AutoGen.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 290px;" src="http://2.bp.blogspot.com/-1rM5_OJutDI/Tdxnb5AAv6I/AAAAAAAAAkk/wuhiLT3MBBY/s400/AutoGen.JPG" alt="" id="BLOGGER_PHOTO_ID_5610472964651794338" border="0" /&gt;&lt;/a&gt;You can also edit the default deployment profile (i.e. SmmTest_application1--EAR File) or create a new one if needed.&lt;br /&gt;&lt;br /&gt;There are two options for the deployment:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Deployed to Ear&lt;/li&gt;&lt;li&gt;Deployed to Application Server&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;If you want to deploy your application directly to the server, configure &lt;span style="font-style: italic;"&gt;Resource Palette &lt;/span&gt;with a new &lt;span style="font-style: italic;"&gt;Application Server Connection &lt;/span&gt;(i.e., xbox) as follows:&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-USREjetA_zk/TdxpdP7hRYI/AAAAAAAAAks/3tOvCoj0_v0/s1600/AppServer.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 297px; height: 284px;" src="http://4.bp.blogspot.com/-USREjetA_zk/TdxpdP7hRYI/AAAAAAAAAks/3tOvCoj0_v0/s400/AppServer.JPG" alt="" id="BLOGGER_PHOTO_ID_5610475187010094466" border="0" /&gt;&lt;/a&gt;You then deploy your application using context menu.  Right select your application and select Deploy.  Choose the destination to be your application server (i.e., &lt;span style="font-style: italic;"&gt;xbox&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/03/database-connections-in-jdeveloper-11.html"&gt;Database Connections in JDeveloper 11 &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.oracle.com/smuenchadf/entry/jdbc_datasources_work_in_the_b"&gt;JDBC Datasources Work in the Business Components Browser in 11g &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://st-curriculum.oracle.com/obe/fmw/wls/10g/r3/appdeploy/configure/datasource/conf_ds_wls.htm"&gt;Configuring JDBC Data Sources&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jdbc_admin/jdbc_datasources.html#wp1167318"&gt;Configuring JDBC Data Sources &lt;/a&gt;(WebLogic)&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/webcenter.1111/e10148/jpsdg_deploy.htm#BGBEHJAJ"&gt;What You May Need to Know About JDBC DataSource&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html"&gt;Oracle WebLogic Server Downloads &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-6416673769929053996?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/n_jPRFLKk1o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/6416673769929053996/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=6416673769929053996" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/6416673769929053996?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/6416673769929053996?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/n_jPRFLKk1o/configuring-jdbc-data-sources-in.html" title="Configuring JDBC Data Sources in JDeveloper and Oracle WebLogic Server" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-tu_COIPcrNQ/TdxOtA1j36I/AAAAAAAAAkU/geI-TOSN9hs/s72-c/JDBC_URL.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/05/configuring-jdbc-data-sources-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IDSX0zeip7ImA9WhZVEEU.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-1767651424129158883</id><published>2011-05-17T14:19:00.000-07:00</published><updated>2011-05-22T10:32:58.382-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-22T10:32:58.382-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="af:commandLink" /><category scheme="http://www.blogger.com/atom/ns#" term="ADF Model" /><category scheme="http://www.blogger.com/atom/ns#" term="ADF Faces" /><category scheme="http://www.blogger.com/atom/ns#" term="ADF Business Components" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle ADF 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="af:table" /><title>Exposing List Model Instance as Table Component in Oracle ADF</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ND8v6qHhARFYijo7Cj5tcVYGzP4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ND8v6qHhARFYijo7Cj5tcVYGzP4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ND8v6qHhARFYijo7Cj5tcVYGzP4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ND8v6qHhARFYijo7Cj5tcVYGzP4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Oracle ADF is based on the Model-View-Controller (MVC) design pattern. Separating applications into these layers simplifies maintenance and reuse of components across applications.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-1PVEpj5tW2o/TdQSqtW41BI/AAAAAAAAAiM/d21XtAlMIkA/s1600/NewPost0.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 252px;" src="http://1.bp.blogspot.com/-1PVEpj5tW2o/TdQSqtW41BI/AAAAAAAAAiM/d21XtAlMIkA/s400/NewPost0.JPG" alt="" id="BLOGGER_PHOTO_ID_5608127960922510354" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;The Task&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this article, we will show how to create a table component (i.e., &lt;a href="http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_table.html"&gt;af:table&lt;/a&gt;) using a custom method in the Application Module.  This custom method returns a List instance whose items will be displayed as rows in the table.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-v5EvW1yXxgg/TdQeiBhAL5I/AAAAAAAAAiU/6AHbvgsmEVU/s1600/NewPost12.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 206px;" src="http://3.bp.blogspot.com/-v5EvW1yXxgg/TdQeiBhAL5I/AAAAAAAAAiU/6AHbvgsmEVU/s400/NewPost12.JPG" alt="" id="BLOGGER_PHOTO_ID_5608141005854355346" border="0" /&gt;&lt;/a&gt;Here &lt;a href="http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_table.html"&gt;af:table &lt;/a&gt;exists in the View layer.  Our custom method which provides table contents exists in the Business layer.  This custom method is exposed on the client interface of an Application Module and exported to the Model layer as data control and binding object.&lt;br /&gt;&lt;br /&gt;In this article, we will show how to achieve this.  Before you start, read this &lt;a href="http://xmlandmore.blogspot.com/2011/05/invoking-application-module-custom.html"&gt;companion article&lt;/a&gt; first.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The Background &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_table.html"&gt;Table component &lt;/a&gt;uses a model to access the data in the underlying list. The specific model class is &lt;code&gt;oracle.adf.view.rich.model.CollectionModel&lt;/code&gt;.  You may also use other model instances, e.g., &lt;code&gt;java.util.List&lt;/code&gt;, array, and &lt;code&gt;javax.faces.model.DataModel&lt;/code&gt;. The Table will automatically convert the instance into a CollectionModel.&lt;br /&gt;&lt;br /&gt;Normally, you would create table using ADF View Object which is exported to the Model layer. You create an ADF bound ADF Faces table by dragging a collection from the ADF Data Controls panel to a page or page fragment.  Using this approach, you can get access to its CollectionModel easily.  However, for some cases, creating a View Object can be difficult.  For example, our query using &lt;a href="http://xmlandmore.blogspot.com/2011/02/overview-of-oracle-database-semantic.html"&gt;Oracle Semantic Technology &lt;/a&gt;doesn't allow us to use bind variable.&lt;br /&gt;&lt;pre&gt;select  postab.post_id, postab.content_value&lt;br /&gt;from table(sem_match('(?s &amp;lt;http://xmlns.oracle.com/rdfctx/property/hasXxxOf&amp;gt;   &amp;lt;http://xmlns.oracle.com/rdfctx/organization/oracle&amp;gt;)',&lt;br /&gt;&amp;nbsp;&amp;nbsp;sem_models('smm_vpd_model_1','smm_ontology_model'),&lt;br /&gt;&amp;nbsp;&amp;nbsp;sem_rulebases('owlprime'), null, null))  graph,&lt;br /&gt;&amp;nbsp;&amp;nbsp;smm.smm_vpd_rdf_data_1 app,&lt;br /&gt;&amp;nbsp;&amp;nbsp;smm.smm_posts postab&lt;br /&gt;where app.triple.rdf_p_id=oracle_orardf_res2vid('http://xmlns.oracle.com/rdfctx/property/hasXxxOf')&lt;br /&gt;&amp;nbsp;&amp;nbsp;and app.triple.rdf_c_id=oracle_orardf_res2vid('http://xmlns.oracle.com/rdfctx/organization/oracle')&lt;br /&gt;&amp;nbsp;&amp;nbsp;and graph.s$RDFVID=app.triple.rdf_s_id&lt;br /&gt;&amp;nbsp;&amp;nbsp;and postab.post_id=app.post_id&lt;br /&gt;;&lt;br /&gt;&lt;/pre&gt;Ideally, we would like to make &lt;span style="font-style: italic;"&gt;object &lt;/span&gt;in the RDF triple a bind variable.  Since &lt;code&gt;sem_match&lt;/code&gt; is an operator and doesn't allow that.  The workaround will be creating a custom method which returns a List instance.  Within the method, we create a custom query statement based on the name of an object (i.e., "oracle").  The signature of the custom method will be:&lt;br /&gt;&lt;pre&gt;public List&amp;lt;postobj&gt; positivePostsByBrand(String brandName) {&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The Steps&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Because of dependencies, we will work from Business Layer back to View Layer.  All &lt;span style="font-style: italic;"&gt;Fusion Web Applications&lt;/span&gt; are created with two projects:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Model&lt;/li&gt;&lt;li&gt;ViewController&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;For step 1 below, we will work in the &lt;span style="font-style: italic;"&gt;Model &lt;/span&gt;project.  For other steps, we will work in the &lt;span style="font-style: italic;"&gt;ViewController &lt;/span&gt;project.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Step 1: Add Custom Method to the AM&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add our custom method (i.e., &lt;code&gt;positivePostsByBrand&lt;/code&gt;) to the Application Module:&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-EQ0YViv6hJw/TdQp-T8vOYI/AAAAAAAAAic/dKZwQ3TppQ4/s1600/NewPost1.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 170px;" src="http://3.bp.blogspot.com/-EQ0YViv6hJw/TdQp-T8vOYI/AAAAAAAAAic/dKZwQ3TppQ4/s400/NewPost1.JPG" alt="" id="BLOGGER_PHOTO_ID_5608153586466765186" border="0" /&gt;&lt;/a&gt;Shuttle custom method from the available list to the selected list:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-fAfkcGKdNNE/TdQuO60EJKI/AAAAAAAAAi0/_q36fUzKQtk/s1600/NewPost2.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 278px;" src="http://2.bp.blogspot.com/-fAfkcGKdNNE/TdQuO60EJKI/AAAAAAAAAi0/_q36fUzKQtk/s400/NewPost2.JPG" alt="" id="BLOGGER_PHOTO_ID_5608158269823788194" border="0" /&gt;&lt;/a&gt;In the Data Controls panel, you should find the new custom method listed under your application module.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Step 2: Create MethodAction Binding Object&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Select the  JSF page to which you want to add the new table.  In its &lt;span style="font-style: italic;"&gt;Bindings &lt;/span&gt;view, create a new binding object using the new data control object (i.e. our custom method &lt;code&gt;positivePostsByBrand&lt;/code&gt;).  By default, the binding objects are named after the data control object that was used to create it.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-jKEqHpVPfCs/TdQsTwNcvNI/AAAAAAAAAis/DeJM3yviaS4/s1600/NewPost3.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 169px;" src="http://2.bp.blogspot.com/-jKEqHpVPfCs/TdQsTwNcvNI/AAAAAAAAAis/DeJM3yviaS4/s400/NewPost3.JPG" alt="" id="BLOGGER_PHOTO_ID_5608156153853557970" border="0" /&gt;&lt;/a&gt;Our new binding object will be &lt;span style="font-style: italic;"&gt;methodAction &lt;/span&gt;(under &lt;span style="font-style: italic;"&gt;Generic Bindings&lt;/span&gt;) item type:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-eAvyvcTeCJM/TdQu2zD7KCI/AAAAAAAAAi8/bnM_qTTXFf8/s1600/NewPost4.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 339px;" src="http://1.bp.blogspot.com/-eAvyvcTeCJM/TdQu2zD7KCI/AAAAAAAAAi8/bnM_qTTXFf8/s400/NewPost4.JPG" alt="" id="BLOGGER_PHOTO_ID_5608158954937591842" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;On &lt;span style="font-style: italic;"&gt;Create Action Binding&lt;/span&gt;, select your AM (i.e., &lt;code&gt;SemAppModuleDataControl&lt;/code&gt;).    No, don't expand its contents.  Look underneath for an &lt;span style="font-style: italic;"&gt;Operation &lt;/span&gt;drop-down list.  Select your custom method.  Take a note of the name of its parameter (i.e., &lt;code&gt;brandName&lt;/code&gt;) which you need to use  later.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-AtNEz85Zm-M/TdQzuxEHsuI/AAAAAAAAAjM/LBet9LHAaTk/s1600/NewPost5.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 392px;" src="http://1.bp.blogspot.com/-AtNEz85Zm-M/TdQzuxEHsuI/AAAAAAAAAjM/LBet9LHAaTk/s400/NewPost5.JPG" alt="" id="BLOGGER_PHOTO_ID_5608164314520728290" border="0" /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);" class=" down" style="display: block;" id="formatbar_CreateLink" title="Link"&gt;&lt;img src="http://www.blogger.com/img/blank.gif" alt="Link" class="gl_link" border="0" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Step 3: Create a New Getter Method on a Managed Bean&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We need a getter method on a &lt;a href="http://xmlandmore.blogspot.com/2009/11/managed-beans-in-oracle-fusion-web.html"&gt;managed bean&lt;/a&gt;, which will fetch table contents on behave of View layer.   For this exercise, we have created a managed bean named &lt;code&gt;ActionBean&lt;/code&gt; which it has been registered on the ADF's unbounded task flow (i.e., &lt;span style="font-style: italic;"&gt;adfc-conf.xml&lt;/span&gt;):&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-7DsvEfl2g_A/TdQ6507R4tI/AAAAAAAAAj0/IUZmrMHlMcc/s1600/MangedBean.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 203px;" src="http://3.bp.blogspot.com/-7DsvEfl2g_A/TdQ6507R4tI/AAAAAAAAAj0/IUZmrMHlMcc/s400/MangedBean.JPG" alt="" id="BLOGGER_PHOTO_ID_5608172201117344466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This managed bean has a &lt;span style="font-style: italic;"&gt;session &lt;/span&gt;scope.  Our getter method in &lt;span style="font-style: italic;"&gt;ActionBean.java &lt;/span&gt;looks like this:&lt;br /&gt;&lt;pre&gt;public List&amp;lt;PostObj&amp;gt; getPositivesByBrand() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;if (getBrandName() == null || getBrandName().length() == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return new ArrayList&amp;lt;PostObj&amp;gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OperationBinding oper = getOperBindings("positivePostsByBrand")  ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Map params = oper.getParamsMap();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;params.put("brandName", brandName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;oper.execute();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return (List&amp;lt;PostObj&amp;gt;)oper.getResult();&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Within it, it uses a binding object named &lt;code&gt;positivePostsByBrand&lt;/code&gt; to fetch table contents from the business layer (i.e., via our custom method defined in the Application Module implementation file).  To execute our custom method, we also need a parameter named &lt;code&gt;brandName&lt;/code&gt;.  We will discuss how to provide this parameter at runtime later.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Step 4: Create New Table on JSF Page&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Select the component (i.e., &lt;a href="http://dadvmc0454.us.oracle.com:9002/faces-11.1.1.4.0/docs/tagdoc/af_panelHeader.html"&gt;af:panelHeader&lt;/a&gt;) that you want to insert the new table to and insert a new ADF Faces component (i.e., af:table):&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-OLz3DOFO_TM/TdQ2EAWbEWI/AAAAAAAAAjU/o0cwl-3SCTY/s1600/NewPost6.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 159px;" src="http://2.bp.blogspot.com/-OLz3DOFO_TM/TdQ2EAWbEWI/AAAAAAAAAjU/o0cwl-3SCTY/s400/NewPost6.JPG" alt="" id="BLOGGER_PHOTO_ID_5608166878424535394" border="0" /&gt;&lt;/a&gt;On &lt;span style="font-style: italic;"&gt;Insert ADF Faces Item&lt;/span&gt;, select &lt;span style="font-style: italic;"&gt;Table&lt;/span&gt;:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-WoXysAyK9FY/TdQ3OU9ilkI/AAAAAAAAAjc/NhfkNCCzMnI/s1600/NewPost7.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 338px; height: 326px;" src="http://2.bp.blogspot.com/-WoXysAyK9FY/TdQ3OU9ilkI/AAAAAAAAAjc/NhfkNCCzMnI/s400/NewPost7.JPG" alt="" id="BLOGGER_PHOTO_ID_5608168155267634754" border="0" /&gt;&lt;/a&gt;On &lt;span style="font-style: italic;"&gt;Create ADF Faces Table&lt;/span&gt;, check &lt;span style="font-style: italic;"&gt;Bind Data Now&lt;/span&gt; and click &lt;span style="font-style: italic;"&gt;Browse...&lt;/span&gt;:&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-o1z8bIVnRG8/TdQ3paoC5mI/AAAAAAAAAjk/Sicn2txqnhM/s1600/NewPost8.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 225px;" src="http://2.bp.blogspot.com/-o1z8bIVnRG8/TdQ3paoC5mI/AAAAAAAAAjk/Sicn2txqnhM/s400/NewPost8.JPG" alt="" id="BLOGGER_PHOTO_ID_5608168620644558434" border="0" /&gt;&lt;/a&gt;You will find our variable named &lt;code&gt;positivesByBrand&lt;/code&gt; (i.e., exposed by the getter method) under ADF Managed Bean &amp;gt; actionBean.  Select it and an EL will be created automatically for you.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-ewbYe_gmFl8/TdQ4JHfT7yI/AAAAAAAAAjs/pACvdxsLAyQ/s1600/NewPost9.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 267px;" src="http://2.bp.blogspot.com/-ewbYe_gmFl8/TdQ4JHfT7yI/AAAAAAAAAjs/pACvdxsLAyQ/s400/NewPost9.JPG" alt="" id="BLOGGER_PHOTO_ID_5608169165263466274" border="0" /&gt;&lt;/a&gt;Next we will create new columns mapped to the properties of the List instance object (i.e., PostObj).  Click &lt;span style="font-style: italic;"&gt;New&lt;/span&gt;:&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-3Z9hCLP5VSc/TdQ-XHsC_OI/AAAAAAAAAj8/E-pgY6y-lfg/s1600/NewPost10.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 178px;" src="http://1.bp.blogspot.com/-3Z9hCLP5VSc/TdQ-XHsC_OI/AAAAAAAAAj8/E-pgY6y-lfg/s400/NewPost10.JPG" alt="" id="BLOGGER_PHOTO_ID_5608176002904816866" border="0" /&gt;&lt;/a&gt;Add new columns as shown.  Their values will be mapped to the property's on our List instance object (i.e.,&lt;code&gt;PostObj&lt;/code&gt;).&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-laZJ8yx8Pbw/TdQ-2jBq7-I/AAAAAAAAAkE/PAnt_FmF4NQ/s1600/NewPost11.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 192px;" src="http://3.bp.blogspot.com/-laZJ8yx8Pbw/TdQ-2jBq7-I/AAAAAAAAAkE/PAnt_FmF4NQ/s400/NewPost11.JPG" alt="" id="BLOGGER_PHOTO_ID_5608176542819217378" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The Missing Link&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As noted above, to execute the custom method we need a parameter (i.e., &lt;code&gt;brandName&lt;/code&gt;).  To provide that, we need to dynamically select that name from the UI.  For example, in a master table, you may display rows with different brand name on each row.  The brand name (or the &lt;code&gt;count&lt;/code&gt; in our case) can then be implemented as an &lt;a href="http://dadvmc0454.us.oracle.com:9002/faces-11.1.1.4.0/docs/tagdoc/af_commandLink.html"&gt;&lt;code&gt;af:commandLink&lt;/code&gt;&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;af:commandLink  id="cl1" actionListener="#{actionsBean.positivePostsByBrand}"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;af:outputText value="#{row.count}" id="ot5"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;f:attribute name="posBrandName" value="#{row.brand}"/&amp;gt;&lt;br /&gt;&amp;lt;/af:commandLink&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-rmLVp0AJ_zg/TdRenKRBTUI/AAAAAAAAAkM/WFOJPLVNhUg/s1600/BrandName.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 351px; height: 67px;" src="http://4.bp.blogspot.com/-rmLVp0AJ_zg/TdRenKRBTUI/AAAAAAAAAkM/WFOJPLVNhUg/s400/BrandName.JPG" alt="" id="BLOGGER_PHOTO_ID_5608211462846762306" border="0" /&gt;&lt;/a&gt;Upon clicking, it will dispatch an &lt;span style="font-style: italic;"&gt;ActionEvent &lt;/span&gt;which will be consumed by a listener (i.e., &lt;code&gt;positivePostsByBrand&lt;/code&gt; method on our managed bean).  Within the method, it will retrieve an attribute named &lt;code&gt;posBrandName&lt;/code&gt; from the event's source object as such:&lt;br /&gt;&lt;pre&gt;public void positivePostsByBrand( ActionEvent actionEvent){&lt;br /&gt;&amp;nbsp;&amp;nbsp;RichCommandLink _table = (RichCommandLink) actionEvent.getSource();&lt;br /&gt;&amp;nbsp;&amp;nbsp;String brandName = (String) _table.getAttributes().get("posBrandName");&lt;br /&gt;&amp;nbsp;&amp;nbsp;// set brand name to be used in getPositivesByBrand method&lt;br /&gt;&amp;nbsp;&amp;nbsp;setBrandName(brandName);&lt;br /&gt;&amp;nbsp;&amp;nbsp;getPositivesByBrand();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Note that attribute &lt;code&gt;posBrandName&lt;/code&gt; will be set to be:&lt;br /&gt;&lt;pre&gt;#{row.brand}&lt;/pre&gt;as defined in the &lt;code&gt;af:commandLink&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://dadvmc0454.us.oracle.com:9002/faces-11.1.1.4.0/docs/enhanced-tagdoc.html"&gt;ADF Faces Rich Client&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html"&gt;Implement Contextual Event&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/developer-tools/adf/learnmore/23-generic-table-selection-listener-169162.pdf"&gt;How-to Build a Generic Selection Listener for ADF bound Tables&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/05/invoking-application-module-custom.html"&gt;Invoking Application Module Custom Methods from Oracle ADF Frontend—Why and How?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/05/action-bindings-and-method-bindings-in.html"&gt;Action Bindings and Method Bindings in Oracle ADF 11g &lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-1767651424129158883?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/Pg7LgMYd5bg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/1767651424129158883/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=1767651424129158883" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/1767651424129158883?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/1767651424129158883?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/Pg7LgMYd5bg/exposing-list-model-instance-as-table.html" title="Exposing List Model Instance as Table Component in Oracle ADF" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-1PVEpj5tW2o/TdQSqtW41BI/AAAAAAAAAiM/d21XtAlMIkA/s72-c/NewPost0.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/05/exposing-list-model-instance-as-table.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YHQHY9eCp7ImA9WhRbEEg.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-2793653588402636305</id><published>2011-05-15T08:39:00.000-07:00</published><updated>2012-01-31T17:18:51.860-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-31T17:18:51.860-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse Memory Analyzer" /><category scheme="http://www.blogger.com/atom/ns#" term="Garbage Collection" /><category scheme="http://www.blogger.com/atom/ns#" term="HPROF" /><category scheme="http://www.blogger.com/atom/ns#" term="Java VM Options" /><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="JDeveloper 11g" /><title>Diagnosing Java.lang.OutOfMemoryError</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/c6_UPm-Wo90WfAkEX9FW0dsv3ck/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c6_UPm-Wo90WfAkEX9FW0dsv3ck/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/c6_UPm-Wo90WfAkEX9FW0dsv3ck/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c6_UPm-Wo90WfAkEX9FW0dsv3ck/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;When I ran my application, it threw the following exceptions:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;java.lang.OutOfMemoryError: GC overhead limit exceeded&lt;sup&gt;[7,9]&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;java.lang.OutOfMemoryError: Java heap space&lt;/li&gt;
&lt;/ul&gt;
The first message means that, for some reason, the garbage collector is taking an excessive amount of time and recovers very little memory in each run. After I removed the following statement:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;System.gc();&lt;/li&gt;
&lt;/ul&gt;
The 1st message was gone. However, the system threw the 2nd message. So, obviously my heap space issue remains. Here are the steps that I took to investigate it:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Add the following Java Options &lt;ul&gt;
&lt;li&gt;-Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps &lt;ul&gt;
&lt;li&gt;System will generate a &lt;code&gt;gc.log&lt;/code&gt; file&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;-XX:+HeapDumpOnOutOfMemoryError &lt;ul&gt;
&lt;li&gt;System will generate a heap dump file&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Analyze the log files: &lt;ul&gt;
&lt;li&gt;Use regular text editor to examine &lt;code&gt;gc.log&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Use &lt;a href="http://www.vogella.de/articles/EclipseMemoryAnalyser/article.html"&gt;Eclipse Memory Analyzer &lt;/a&gt;to examine heap dump file (i.e., java_xxx.hprof) &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
Note that all command options discussed in this article applied to Hotspot VM.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 130%; font-weight: bold;"&gt;JVM Options&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The command line options specify:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-XX:+PrintGCDetails&lt;/code&gt; &lt;ul&gt;
&lt;li&gt;prints more details at garbage collection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-XX:+PrintGCTimeStamps&lt;/code&gt; &lt;ul&gt;
&lt;li&gt;prints a time stamp representing the number of seconds since the HotSpot VM was launched until the garbage collection occurred.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-Xloggc:gc.log&lt;/code&gt; &lt;ul&gt;
&lt;li&gt;causes information about the heap and garbage collection to be printed at each collection.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
To set &lt;code&gt;Java Options&lt;/code&gt; in JDeveloper, do the following:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Right select your project (i.e., &lt;code&gt;ViewController&lt;/code&gt;) and bring up the context menu&lt;/li&gt;
&lt;li&gt;Select Project Properties...&lt;/li&gt;
&lt;li&gt;Select Run/Debug/Profile&lt;/li&gt;
&lt;li&gt;Select your Run Configuration (i.e., &lt;code&gt;Default&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Click Edit button&lt;/li&gt;
&lt;li&gt;Specify &lt;code&gt;-Xloggc:gc.log -XX:-PrintGCDetails&lt;/code&gt; in the Java Options field&lt;/li&gt;
&lt;/ol&gt;
&lt;a href="http://3.bp.blogspot.com/-Wk9-XBuyoV8/TdAMczaBAuI/AAAAAAAAAhk/6TnDYNTa9d0/s1600/RunDebug.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5606995225051464418" src="http://3.bp.blogspot.com/-Wk9-XBuyoV8/TdAMczaBAuI/AAAAAAAAAhk/6TnDYNTa9d0/s400/RunDebug.JPG" style="cursor: pointer; display: block; height: 196px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;Run your application and reproduce the out-of-memory exception. A log file named &lt;code&gt;gc.log&lt;/code&gt; will be generated. I've found mine in the following location:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;.../system11.1.1.5.37.60.13/DefaultDomain&lt;/li&gt;
&lt;/ul&gt;
because my web application was deployed to the Integrated WLS&lt;sup&gt;[4]&lt;/sup&gt; and run from DefaultDomain. To understand the format of &lt;code&gt;gc.log&lt;/code&gt;, read [5] for details.&lt;br /&gt;
&lt;br /&gt;
However, &lt;code&gt;gc.log&lt;/code&gt; file was not really helpful because it simply pointed out there was a heap issue. But, it didn't say where.&lt;br /&gt;
&lt;br /&gt;
The next step I have taken is running my server with the following flag:&lt;br /&gt;
&lt;br /&gt;
-&lt;b&gt;XX:+HeapDumpOnOutOfMemoryError&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
it generated a &lt;code&gt;java_pid30835.hprof&lt;/code&gt; file when my server encountered a heap error.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Eclipse Memory Analyzer &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The heap dump file (i.e., &lt;code&gt;java_pid30835.hprof&lt;/code&gt;) is generated by &lt;a href="http://java.sun.com/developer/technicalArticles/Programming/HPROF.html"&gt;HPROF&lt;/a&gt;—a heap and cpu profiling tool. My heap dump file was generated in binary format. Therefore I need to use &lt;a href="http://www.vogella.de/articles/EclipseMemoryAnalyser/article.html"&gt;Eclpse Memory Analyzer &lt;/a&gt;to examine it.&lt;br /&gt;
&lt;br /&gt;
You can install Eclipse MAT via the &lt;a href="http://www.vogella.de/articles/Eclipse/article.html#updatemanager"&gt;Eclipse Update manager &lt;/a&gt;. Select "General Purpose Tools " and install "Memory Analyser (Incubation)" and "Memory Analyser (Charts)".&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/-lYhQ29J1wGM/TdBdYOyKRzI/AAAAAAAAAhs/ItluSFW3cN4/s1600/EclipseMat.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5607084206942996274" src="http://1.bp.blogspot.com/-lYhQ29J1wGM/TdBdYOyKRzI/AAAAAAAAAhs/ItluSFW3cN4/s400/EclipseMat.JPG" style="cursor: pointer; display: block; height: 302px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;After installation, double-click your heap dump file and select "Leak Suspects Report".&lt;br /&gt;
&lt;a href="http://4.bp.blogspot.com/-3LSFdfA5uvM/TdBeOKiZhVI/AAAAAAAAAh8/B6L3ypbGnRw/s1600/LeakReport.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5607085133516080466" src="http://4.bp.blogspot.com/-3LSFdfA5uvM/TdBeOKiZhVI/AAAAAAAAAh8/B6L3ypbGnRw/s400/LeakReport.JPG" style="cursor: pointer; display: block; height: 342px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;Eclipse MAT will show a diagram:&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-fgp5_c9qisI/TdBeFXaKpTI/AAAAAAAAAh0/UNeFIJAk97E/s1600/LeakSuspect.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5607084982352389426" src="http://2.bp.blogspot.com/-fgp5_c9qisI/TdBeFXaKpTI/AAAAAAAAAh0/UNeFIJAk97E/s400/LeakSuspect.JPG" style="cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;and problem suspects:&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-Zw3d9L-I6O0/TdBezyHAO0I/AAAAAAAAAiE/_DuW2ak9Rg8/s1600/ProblemSuspect.JPG"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5607085779793754946" src="http://2.bp.blogspot.com/-Zw3d9L-I6O0/TdBezyHAO0I/AAAAAAAAAiE/_DuW2ak9Rg8/s400/ProblemSuspect.JPG" style="cursor: pointer; display: block; height: 212px; margin: 0px auto 10px; text-align: center; width: 400px;" /&gt;&lt;/a&gt;You can click on the "Details" link to investigate.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Heap Size Adjustment&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you observe an &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;OutOfMemoryError &lt;/span&gt;in the garbage collection logs, try increasing the Java heap size to 80% to 90% of the physical memory you have available for the JVM.&amp;nbsp;&amp;nbsp; Based on whether the&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt; old generation space&lt;/span&gt; or the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;permanent generation space &lt;/span&gt;is running out of memory, you adjust the sizes of heap spaces in this way&lt;sup&gt;[10]&lt;/sup&gt;:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;For &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;old generation space OutOfMemoryErrors&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;increase &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;-Xms&lt;/span&gt; and&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt; -Xmx&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;For &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;permanent generation OutOfMemoryErrors&lt;/span&gt; &lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;increase &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;-XX:PermSize&lt;/span&gt; and &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;-XX:MaxPermSize&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;References&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.vogella.de/articles/Eclipse/article.html#updatemanager"&gt;Eclipse Update Manager&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.vogella.de/articles/EclipseMemoryAnalyser/article.html"&gt;Eclipse Memory Analyzer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html"&gt;Java Hotspot VM Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2011/04/integrated-weblogic-server-wls.html"&gt;Integrated WebLogic Server (WLS) &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://java.sun.com/docs/hotspot/gc1.4.2/example.html" rel="nofollow"&gt;Diagnosing a Garbage Collection problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/java/faq-140837.html"&gt;Frequently Asked Questions about Garbage Collection &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://stackoverflow.com/questions/1393486/what-means-the-error-message-java-lang-outofmemoryerror-gc-overhead-limit-excee"&gt;GC Overhead Limit Exceeded&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/Programming/HPROF.html"&gt;HPROF: A Heap/CPU Profiling Tool in J2SE 5.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.oom"&gt;Java SE 6 HotSpot[tm] Virtual Machine Garbage Collection Tuning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Java Performance &lt;/i&gt;by Charlie Hunt and Binu John&lt;/li&gt;
&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2012/01/understanding-garbage-collection.html" target="_blank"&gt;Understanding Garbage Collection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html" target="_blank"&gt;Java HotSpot VM Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.tagtraum.com/gcviewer.html" target="_blank"&gt;GCViewer&lt;/a&gt; (a free open source tool)&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-2793653588402636305?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/f3eZ7fnyeGk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/2793653588402636305/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=2793653588402636305" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2793653588402636305?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/2793653588402636305?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/f3eZ7fnyeGk/diagnosing-javalangoutofmemory.html" title="Diagnosing Java.lang.OutOfMemoryError" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-Wk9-XBuyoV8/TdAMczaBAuI/AAAAAAAAAhk/6TnDYNTa9d0/s72-c/RunDebug.JPG" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/05/diagnosing-javalangoutofmemory.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcNRX0_fCp7ImA9WhZXGEs.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-5359037541674624380</id><published>2011-05-01T13:30:00.000-07:00</published><updated>2011-05-08T08:04:54.344-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-08T08:04:54.344-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Managed Bean" /><category scheme="http://www.blogger.com/atom/ns#" term="Application Module" /><category scheme="http://www.blogger.com/atom/ns#" term="ADF Faces" /><category scheme="http://www.blogger.com/atom/ns#" term="ADF Business Components" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle ADF 11g" /><title>Invoking Application Module Custom Methods from Oracle ADF Frontend—Why and How?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BOLUIMAvli0TM0MKdcFHk-e8e2c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BOLUIMAvli0TM0MKdcFHk-e8e2c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BOLUIMAvli0TM0MKdcFHk-e8e2c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BOLUIMAvli0TM0MKdcFHk-e8e2c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In an Oracle Fusion web application, you should use managed beans&lt;sup&gt;[4]&lt;/sup&gt; to store logic that is related to the UI rendering only. All application data and processing should be handled by logic in the business layer of the application.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;In this article, we'll show how to refresh a calculated attribute&lt;sup&gt;[6]&lt;/sup&gt; named &lt;em&gt;Total Comments&lt;/em&gt; after user adds a new comment using &lt;em&gt;Create Comment Dialog&lt;/em&gt;. As noted above, refreshing &lt;em&gt;Total Comments&lt;/em&gt; should be handled in ADF backend (i.e., &lt;span style="font-style: italic;"&gt;ADF Business Components&lt;/span&gt;), not ADF frontend (i.e., &lt;span style="font-style: italic;"&gt;ADF Faces&lt;/span&gt;).  Note that ADF backend refers to &lt;em&gt;Model&lt;/em&gt; project and ADF frontend refers to &lt;em&gt;ViewController&lt;/em&gt; project in a Fusion web application.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-yH7EU3Wj5WI/Tb3Ub0hJUkI/AAAAAAAAAhE/SuqW2a-hd40/s1600/ModelAndViewController.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 363px; height: 323px;" src="http://4.bp.blogspot.com/-yH7EU3Wj5WI/Tb3Ub0hJUkI/AAAAAAAAAhE/SuqW2a-hd40/s400/ModelAndViewController.JPG" alt="" id="BLOGGER_PHOTO_ID_5601867085937988162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Background Information&lt;/h3&gt;In the described application, we have two view objects (i.e., &lt;em&gt;TestVO&lt;/em&gt; and &lt;em&gt;TestCommentVO&lt;/em&gt;) with master-detail relationship. "TotalComments" on the &lt;em&gt;TestVO&lt;/em&gt; is a calculated attribute which computes total number of chronological comments (represented by &lt;em&gt;TestCommentVO&lt;/em&gt;) added to a test.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;On the &lt;em&gt;Test View&lt;/em&gt; page, it displays &lt;em&gt;Total Comments&lt;/em&gt; column which is also a link. By clicking on the link, user can navigate to the &lt;em&gt;Test Comment&lt;/em&gt; page. On the Test Comment page, user is allowed to add new comments. After adding new comments, the &lt;em&gt;Total Comments&lt;/em&gt; column on the original &lt;em&gt;Test View&lt;/em&gt; page need to reflect the new total.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://2.bp.blogspot.com/_Y8eLenGvPHg/S2ZhjkVTanI/AAAAAAAAARM/TcI1cmQu1O8/s1600/TestView.JPG" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The Task&lt;/h3&gt;To achieve this task, we need to invoke a custom method implemented in &lt;span style="font-style: italic;"&gt;ADF Business Components&lt;/span&gt; from the &lt;em&gt;Test Comment&lt;/em&gt; component implemented in ADF Faces. Method invokation is triggered when user clicks the &lt;em&gt;Save and Close&lt;/em&gt; button to save the newly created comment.&lt;br /&gt;&lt;p&gt;The bridge provided between ADF frontend and ADF backend is the &lt;span style="font-style: italic;"&gt;Data Binding Layer &lt;/span&gt;in Fusion web application&lt;sup&gt;[3]&lt;/sup&gt;. &lt;a class="bodylink" href="http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html"&gt;ADF data-binding layer&lt;/a&gt; implements the Data Controls and Bindings from &lt;a class="bodylink" href="http://otn.oracle.com/products/jdev/htdocs/techinfo/jsr227.html"&gt;JSR-227&lt;/a&gt;. The data controls abstract the back-end business service implementations and binding objects link front-end user interface controls in a declarative way to back-end data.&lt;br /&gt;&lt;br /&gt;The steps of the task ordered from backend (in blue) to frontend (in black) are summarized here:&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Creating a custom method named &lt;em&gt;refreshTotalComments&lt;/em&gt; in the application module Class (i.e., SelTestPortalAMImpl.java).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#3333ff;"&gt;Exporting &lt;em&gt;refreshTotalComments&lt;/em&gt; by including the method on the application module's UI client interface.&lt;/span&gt; &lt;/li&gt;&lt;li&gt;Adding a new action binding&lt;sup&gt;[5]&lt;/sup&gt; named &lt;em&gt;refreshTotalComments&lt;/em&gt; on &lt;span style="font-style: italic;"&gt;TestCommentPageDef.xml&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Creating a managed bean named &lt;em&gt;TestCommentBean.java&lt;/em&gt; with a method action named &lt;em&gt;saveAndClose&lt;/em&gt;. In the method, it will retrieve and execute &lt;em&gt;refreshTotalComments&lt;/em&gt; operation binding.&lt;/li&gt;&lt;li&gt;Registering new managed bean in &lt;em&gt;adc-config.xml&lt;/em&gt; with the scope of &lt;em&gt;request&lt;/em&gt;.&lt;/li&gt;&lt;li&gt;Linking method action &lt;em&gt;saveAndClose&lt;/em&gt; on the managed bean to the actionlistener of &lt;em&gt;Save and Close&lt;/em&gt; button.&lt;/li&gt;&lt;/ol&gt;In the following sections, we'll describe those steps in details.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Step 1 — Adding Custom Method to the AppModuleImpl File&lt;/h3&gt;To add a custom service method (i.e., &lt;em&gt;refreshTotalComments&lt;/em&gt;) to your application module, you must generate the application module class files first.&lt;br /&gt;&lt;br /&gt;To generate Java files for your application module class:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the &lt;span style="font-style: italic;"&gt;Application Navigator&lt;/span&gt;, double-click the application module.&lt;/li&gt;&lt;li&gt;In the overview editor, click the Java navigation tab and click the Edit java options button.&lt;/li&gt;&lt;li&gt;In the &lt;span style="font-style: italic;"&gt;Select Java Options &lt;/span&gt;dialog, select &lt;span style="font-style: italic;"&gt;Generate Application Module Class&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Click OK. &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;In &lt;span style="font-style: italic;"&gt;SelTestPortalAMImpl.java &lt;/span&gt;file, you add your custom service method — &lt;span style="font-style: italic;"&gt;refreshTotalComments&lt;/span&gt;.  Here we have left out the details of &lt;em&gt;refreshTotalComments&lt;/em&gt;. For ADF developers need to write a custom method such as &lt;em&gt;refreshTotalComments&lt;/em&gt;, you can read &lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/appendix_mostcommon.htm#CACHIEBH"&gt;this document&lt;/a&gt;. It provides a high-level description of the key ADF Business Components classes in the Oracle Application Development Framework and it summarizes the methods that ADF developers write, call, and override most frequently.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Step 2 — Publishing Custom Method on the Application Module’s Client Interface &lt;/h3&gt;To include a public method from your application module's custom Java class on the client interface, use the &lt;em&gt;Java Classes&lt;/em&gt; page of the &lt;em&gt;overview&lt;/em&gt; editor for the application module, and then click the Edit icon in the &lt;em&gt;Client Interface&lt;/em&gt; section of the page to display the &lt;span style="font-style: italic;"&gt;Edit Client Interface&lt;/span&gt; dialog. Select method &lt;em&gt;refreshTotalComments&lt;/em&gt; from the Available list and click the Add button to shuttle them into the Selected list. Then click OK to close the editor. &lt;img src="http://3.bp.blogspot.com/_Y8eLenGvPHg/S2ZMI0AHBKI/AAAAAAAAARE/4M6jARS9yz8/s1600/ClientInterface.JPG" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can include any custom method in the client interface that obeys these implementation rules:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the method has a non-void return type, the type must be serializable (i.e., implements the java.io.Serializable interface). &lt;/li&gt;&lt;li&gt;If the method accepts any parameters, all their types must be serializable. &lt;/li&gt;&lt;li&gt;If the method signature includes a throws clause, the exception must be an instance of &lt;span style="font-style: italic;"&gt;JboException &lt;/span&gt;in the &lt;span style="font-style: italic;"&gt;oracle.jbo &lt;/span&gt;package.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Step 3 — Adding a New Action Binding &lt;/h3&gt;In the &lt;em&gt;ViewController&lt;/em&gt; project, select &lt;span style="font-style: italic;"&gt;Test Comment &lt;/span&gt;page and right click it. From the context menu, select "Go to Page Definition." This will bring you to the &lt;span style="font-style: italic;"&gt;TestCommentPageDef.xml&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In the Overview editor for the &lt;span style="font-style: italic;"&gt;Test Comment &lt;/span&gt;page definition’s &lt;span style="font-style: italic;"&gt;Bindings and Executables &lt;/span&gt;tab, click the Add icon in the Bindings section. Then, follow these steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the &lt;span style="font-style: italic;"&gt;Insert Item &lt;/span&gt;dialog, select &lt;em&gt;methodAction&lt;/em&gt; and click OK.&lt;/li&gt;&lt;li&gt;In the Create Action Binding dialog:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Select the data collection (i.e., &lt;em&gt;SelTestPortalAMDataControl&lt;/em&gt;) where you have created your handler.&lt;/li&gt;&lt;li&gt;From the Operation dropdown list, select the handler (i.e., &lt;em&gt;refreshTotalComments&lt;/em&gt;).&lt;/li&gt;&lt;li&gt;Click OK.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;img src="http://3.bp.blogspot.com/_Y8eLenGvPHg/S2Zk-BHaajI/AAAAAAAAARU/cACrTBgPlS8/s1600/CreateActionBinding.JPG" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Step 4 — Creating a New Managed Bean&lt;/h3&gt;In the &lt;em&gt;ViewController&lt;/em&gt; project, create a managed bean named &lt;em&gt;TestCommentBean.java&lt;/em&gt; with a method action named &lt;em&gt;saveAndClose&lt;/em&gt; as shown below.&lt;br /&gt;&lt;pre&gt;public void saveAndClose(ActionEvent actionEvent) {&lt;br /&gt;try{&lt;br /&gt;// Commit the transaction&lt;br /&gt;OperationBinding  oper = getOperBindings("Commit");&lt;br /&gt;oper.execute();&lt;br /&gt;// refresh total comments&lt;br /&gt;oper = getOperBindings("refreshTotalComments");&lt;br /&gt;oper.execute();&lt;br /&gt;}catch(Exception e){&lt;br /&gt;e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/**&lt;br /&gt;* This methos returns the operation bindings of the passed method name&lt;br /&gt;* @param operation name&lt;br /&gt;* @return&lt;br /&gt;*/&lt;br /&gt;private OperationBinding getOperBindings(String operation) throws Exception&lt;br /&gt;{&lt;br /&gt;OperationBinding oper=null;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;FacesContext facesContext = FacesContext.getCurrentInstance();&lt;br /&gt;ExpressionFactory exp = facesContext.getApplication().getExpressionFactory();&lt;br /&gt;DCBindingContainer bindingContainer =&lt;br /&gt;(DCBindingContainer) exp.createValueExpression(facesContext.getELContext(),&lt;br /&gt;                                      "#{bindings}",&lt;br /&gt;                                       DCBindingContainer.class).getValue(facesContext.getELContext());&lt;br /&gt;// A ControlBinding that binds an datacontrol action, including navigational&lt;br /&gt;// actions such as "Next" and "Prev", or other actions such as "Commit" and&lt;br /&gt;// "Rollback", to a view component.&lt;br /&gt;oper = bindingContainer.getOperationBinding(operation);&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;e.printStackTrace();&lt;br /&gt;}&lt;br /&gt;return oper;&lt;br /&gt;} //end getOperBindings&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As shown in the code, we need to retrieve two operation bindings (i.e., &lt;span style="font-style: italic;"&gt;Commit &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;refreshTotalComments&lt;/span&gt;) from the binding container&lt;sup&gt;[7]&lt;/sup&gt;. Operation binding &lt;em&gt;refreshTotalComments&lt;/em&gt; is used at runtime to invoke our Application Module custom method.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Step 5 — Registering New Managed Bean in adc-config.xml&lt;/h3&gt;&lt;p&gt;As a general rule for Fusion web applications, a bean that may be used in more than one page or task flow, or one that is used by pages within the main unbounded task flow (adfc-config), should be registered in the &lt;em&gt;adfc-config.xml&lt;/em&gt; configuration file.&lt;br /&gt;&lt;br /&gt;To register &lt;em&gt;TotalCommentBean&lt;/em&gt; in &lt;em&gt;adc-config.xml&lt;/em&gt;, do the following:&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;In the Application Navigator, double-click the &lt;span style="font-style: italic;"&gt;adfc-config.xml &lt;/span&gt;file in theWEB-INF folder.&lt;/li&gt;&lt;li&gt;In the editor window for the &lt;span style="font-style: italic;"&gt;adfc-config.xml &lt;/span&gt;file, click the Overview tab.&lt;/li&gt;&lt;li&gt;In the Managed Beans page, in the Managed Beans section click the Add icon and enter &lt;em&gt;TotalCommentBean&lt;/em&gt; as the name of the bean, enter the fully qualified class name, and select &lt;em&gt;request&lt;/em&gt; scope&lt;sup&gt;[8]&lt;/sup&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Step 6 — Linking Method Action to the ActionListener of Button&lt;/h3&gt;The final step is to link method action &lt;em&gt;saveAndClose&lt;/em&gt; on the managed bean to the &lt;span style="font-style: italic;"&gt;actionListener&lt;/span&gt; of &lt;em&gt;Save and Close&lt;/em&gt; button as shown below:&lt;br /&gt;&lt;pre&gt;&amp;lt;af:commandbutton id="FAsc1"&lt;br /&gt;textandaccesskey="#{applcoreBundle.SAVE_AND_CLOSE}"&lt;br /&gt;shortdesc="#{applcoreBundle.SAVE_AND_CLOSE_SHORT_DESC}"&lt;br /&gt;actionlistener="#{TestCommentBean.saveAndClose}"&amp;gt;&lt;br /&gt;&amp;lt;/af:commandbutton&amp;gt;&lt;br /&gt;&lt;/pre&gt;Note that you can achieve this linking declaratively using &lt;span style="font-style: italic;"&gt;Property Inspector&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The Explanation&lt;/h3&gt;An &lt;span style="font-style: italic;"&gt;application module &lt;/span&gt;can expose its data model of view objects to clients without requiring any custom Java code. This allows client code to use the &lt;span style="font-style: italic;"&gt;ApplicationModule&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;ViewObject&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;RowSet&lt;/span&gt;, and &lt;span style="font-style: italic;"&gt;Row &lt;/span&gt;interfaces in the &lt;span style="font-style: italic;"&gt;oracle.jbo &lt;/span&gt;package to work directly with any view object in the data model.&lt;br /&gt;&lt;br /&gt;Whenever there is a need to provide custom codes as shown in our sample application, you should encapsulate the details by writing a custom method in your application module's Java class.&lt;br /&gt;&lt;br /&gt;When working with Fusion web applications using the ADF Model layer for data binding, JDeveloper configures a servlet filter in your user interface project (i.e., &lt;em&gt;ViewController&lt;/em&gt;) called the &lt;em&gt;ADFBindingFilter&lt;/em&gt;. It orchestrates the automatic acquisition and release of an appropriate application module instance based on declarative binding metadata, and ensures that the service is available to be looked up as a data control using a known &lt;em&gt;action binding&lt;/em&gt; or &lt;em&gt;iterator binding&lt;/em&gt;, specified by any page definition file in the user interface project.&lt;br /&gt;&lt;br /&gt;At runtime, you can access the application module's client interface from the &lt;em&gt;DCBindingContainer&lt;/em&gt; by naming an ADF action binding or an ADF iterator binding (see step 4). You can also reference the binding context&lt;sup&gt;[7]&lt;/sup&gt; and call methods on the custom client interface in any JSF managed bean.&lt;br /&gt;&lt;h3&gt;Reference(s)&lt;br /&gt;&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/appendix_mostcommon.htm#CACHIEBH"&gt;Most Commonly Used Methods in ADF Business Components&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://jobinesh.blogspot.com/2009/06/detailed-look-at-binding-model.html"&gt;A detailed look at Binding Model Parameter Options (NDOption)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2009/11/oracle-adf-model-in-depth.html"&gt;Oracle ADF Model In Depth &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2009/11/managed-beans-in-oracle-fusion-web.html"&gt;Managed Beans in Oracle Fusion Web Applications&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/05/action-bindings-and-method-bindings-in.html"&gt;Action Bindings and Method Bindings in Oracle ADF 11g &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2009/12/examining-view-object-attributes-in.html"&gt;Examining View Object Attributes in Oracle ADF 11g&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2010/05/oracle-adf-bindingcontext-and.html"&gt;Oracle ADF BindingContext and BindingContainer &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://xmlandmore.blogspot.com/2009/10/types-of-scopes-in-fusion-web.html"&gt;Types of Memory Scopes in Fusion Web Applications &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Oracle-Fusion-Developer-Guide-Applications/dp/0071622543/ref=ntt_at_ep_dpi_1"&gt;Oracle Fusion Developer Guide: Building Rich Internet Applications with Oracle ADF Business Components and Oracle ADF Faces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/jdevsamples/"&gt;Open Source sample applications for Oracle Fusion Middleware technology&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-5359037541674624380?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/yg3jJ3ZxJp0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/5359037541674624380/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=5359037541674624380" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/5359037541674624380?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/5359037541674624380?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/yg3jJ3ZxJp0/invoking-application-module-custom.html" title="Invoking Application Module Custom Methods from Oracle ADF Frontend—Why and How?" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-yH7EU3Wj5WI/Tb3Ub0hJUkI/AAAAAAAAAhE/SuqW2a-hd40/s72-c/ModelAndViewController.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/05/invoking-application-module-custom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAARH8-cSp7ImA9WhZQGU8.&quot;"><id>tag:blogger.com,1999:blog-748094882401183761.post-8886547988731502610</id><published>2011-04-26T21:42:00.000-07:00</published><updated>2011-04-27T10:52:25.159-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-27T10:52:25.159-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WLS" /><category scheme="http://www.blogger.com/atom/ns#" term="WebLogic Server" /><category scheme="http://www.blogger.com/atom/ns#" term="Oracle JDeveloper 11g" /><category scheme="http://www.blogger.com/atom/ns#" term="Integrated WebLogic Server" /><title>Integrated WebLogic Server (WLS)</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8aRrq4ViLn9ViBLvu_p42xJzvcg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8aRrq4ViLn9ViBLvu_p42xJzvcg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8aRrq4ViLn9ViBLvu_p42xJzvcg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8aRrq4ViLn9ViBLvu_p42xJzvcg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;To run JDeveloper application in a Java EE container, it must be bound to a Server Instance.  &lt;span style="color: rgb(51, 51, 255);"&gt;Integrated WebLogic Server&lt;/span&gt; (&lt;span style="font-weight: bold;"&gt;Integrated WLS&lt;/span&gt;) comes packaged with JDeveloper.  Testing JDeveloper applications on Integrated WLS Server is easy because:&lt;ul&gt;&lt;li&gt;Deployment is optimized and the requirement to zip and copy files is eliminated.&lt;/li&gt;&lt;li&gt;Most files run directly from project directories. This feature enables you to make selected changes and refresh these changes while the application is running. For example, any changes made to a JSPX page can be refreshed immediately, without redeploying the application.&lt;/li&gt;&lt;li&gt;There is no requirement to undeploy applications after testing and debugging. Applications are undeployed when the Default Server becomes unavailable.&lt;/li&gt;&lt;li&gt;JDeveloper enables you to quickly create test users and passwords to test security in Integrated WLS.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Integrated WLS&lt;/h3&gt;You can run your applications directly on &lt;span style="color: rgb(51, 51, 255);"&gt;Integrated WebLogic Server &lt;/span&gt;without the need to deploy. The integrated WLS is sufficient to run your application to make sure it displays correctly in browsers, or for testing and debugging portions of the application. However, real end-to-end testing should be done in a &lt;span style="font-style: italic;"&gt;standalone Administration Server&lt;/span&gt; because that is what will be used in a &lt;span style="font-style: italic;"&gt;production environment&lt;/span&gt;.&lt;br /&gt;&lt;p&gt;JDeveloper is bundled with a WLS domain, and "DefaultServer" is defined for it. All JDeveloper applications are bound by default to "DefaultServer."  In this document, these default settings are assumed.  To view the properties of "DefaultServer" Server Instance, in the Application-&amp;gt;Application Properties...-&amp;gt;Run panel, select "Application Server Properties".&lt;/p&gt;&lt;a href="http://2.bp.blogspot.com/-6QY_iz5jz1A/TbeiT4-p3FI/AAAAAAAAAgU/RVuljyX-9Hc/s1600/IntegratedWLS.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 360px;" src="http://2.bp.blogspot.com/-6QY_iz5jz1A/TbeiT4-p3FI/AAAAAAAAAgU/RVuljyX-9Hc/s400/IntegratedWLS.JPG" alt="" id="BLOGGER_PHOTO_ID_5600123124254891090" border="0" /&gt;&lt;/a&gt;Alternatively, you can view the properties of &lt;span style="font-style: italic;"&gt;IntegratedWebLogicServer &lt;/span&gt;from the &lt;span style="font-style: italic;"&gt;Application Server Navigator&lt;/span&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;If necessary, open the &lt;span style="font-style: italic;"&gt;Application Server Navigator &lt;/span&gt;by choosing View-&amp;gt;Application Server Navigator.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Right-click the &lt;span style="font-style: italic;"&gt;IntegratedWebLogicServer &lt;/span&gt;connection and choose &lt;span style="font-style: italic;"&gt;Properties&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a href="http://2.bp.blogspot.com/-0Z8um2rxCmg/TbeoXuMWm6I/AAAAAAAAAgc/SD66evoOfS8/s1600/AppServViewer.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 182px;" src="http://2.bp.blogspot.com/-0Z8um2rxCmg/TbeoXuMWm6I/AAAAAAAAAgc/SD66evoOfS8/s400/AppServViewer.JPG" alt="" id="BLOGGER_PHOTO_ID_5600129787148802978" border="0" /&gt;&lt;/a&gt;&lt;h3&gt;DefaultDomain&lt;/h3&gt;&lt;p&gt;"DefaultDomain" is bundled with JDeveloper.  If you have not explicitly created Integrated WebLogic Server's default domain, it will automatically be created with default settings when you start the server by running or debugging an application.  The default domain and its associated default server is located here:&lt;/p&gt;&lt;pre space="preserve" class="oac_no_warn"&gt;$JDEV_USER_HOME/system11.1.1.1.32.53.52/DefaultDomain/server/DefaultServer&lt;/pre&gt;&lt;p&gt;Every Server Instance requires a unique Application Server Connection.  "DefaultServer" Server Instance uses bundled &lt;span style="font-style: italic;"&gt;Application Server Connection&lt;/span&gt; named "&lt;span style="color: rgb(51, 51, 255);"&gt;IntegratedWebLogicServer&lt;/span&gt;" (see Figure). &lt;span style="color: rgb(51, 51, 255);"&gt;IntegratedWebLogicServer &lt;/span&gt;is used by Integrated WLS for deployment and server management.  This connection is visible in the &lt;span style="font-style: italic;"&gt;Application Server Navigator&lt;/span&gt; and the &lt;span style="font-style: italic;"&gt;Resource Palette&lt;/span&gt;, and can be used to browse and manage this instance.&lt;a href="http://1.bp.blogspot.com/-3WIpXm03xyo/TbhKO1R7RWI/AAAAAAAAAgk/q1W6xdWxSvk/s1600/ResourcePallete.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 187px;" src="http://1.bp.blogspot.com/-3WIpXm03xyo/TbhKO1R7RWI/AAAAAAAAAgk/q1W6xdWxSvk/s400/ResourcePallete.JPG" alt="" id="BLOGGER_PHOTO_ID_5600307755316102498" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;With a fresh installation of JDeveloper, the "&lt;span style="font-style: italic;"&gt;DefaultServer&lt;/span&gt;" Server Instance and the "&lt;span style="color: rgb(51, 51, 255);"&gt;IntegratedWebLogicServer&lt;/span&gt;" Application Server Connection are only created the first time a &lt;span style="font-style: italic;"&gt;Integrated WLS&lt;/span&gt; related action is taken. The actions are: running/debugging/profiling a Java EE application, editing the Server Instances, or editing the application properties-&amp;gt;Run properties.  The Server Instance must be started once, after which any application can be run repeatedly. You can also start &lt;span style="font-style: italic;"&gt;Integrated WLS&lt;/span&gt; without starting application as shown below.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;h3 class="sect2"&gt;How to Start Integrated WLS&lt;/h3&gt;&lt;p&gt;Options for starting Integrated WLS are available in the Run menu in JDeveloper.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;To start it in debug mode, from the &lt;span class="bold"&gt;Run&lt;/span&gt; menu, select &lt;span style="font-style: italic;" class="bold"&gt;Debug Server Instance&lt;/span&gt;.&lt;br /&gt;&lt;p&gt;It is recommended that the service be run in debug mode as it helps in debugging the service.&lt;/p&gt;&lt;/li&gt;&lt;li&gt;To start it in the regular mode, from the &lt;span class="bold"&gt;Run&lt;/span&gt; menu, select &lt;span style="font-style: italic;" class="bold"&gt;Start Server Instance&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;There are a couple of ways to determine if Integrated WLS is running:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;From the &lt;span class="bold"&gt;View&lt;/span&gt; menu, select &lt;span class="bold"&gt;Log&lt;/span&gt;, and look for the following entry:&lt;br /&gt;&lt;pre class="oac_no_warn" space="preserve"&gt;IntegratedWebLogicServer started&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Access the Integrated WLS console from a browser using weblogic/weblogic1 credential:&lt;br /&gt;&lt;pre class="oac_no_warn" space="preserve"&gt;http://localhost:7101/console&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;The first time the Integrated WLS starts, it tries to use the first available port in the 7101 - 7105 range. The following message appears as the first line in the Default server log in JDeveloper. You should use the chosen port for all access:&lt;br /&gt;&lt;div class="infoboxnote"&gt;&lt;pre space="preserve" class="oac_no_warn"&gt;*** Using port 7101 ***&lt;br /&gt;or&lt;br /&gt;HTTP port conflict detected. The HTTP port will be reassigned to port 7102.&lt;/pre&gt;When you run your application in JDeveloper using the run or debug commands, the Integrated WLS server starts automatically and your application runs in the target browser.  When the Run or Debug action is selected on a Java EE node, Integrated WLS runs the entire application and all its projects as a Java EE Application in a Java EE container ("DefaultServer"). Each node type may optionally trigger additional actions, such as launching a browser.&lt;br /&gt;&lt;/div&gt;&lt;h3&gt;Adminstration Console&lt;/h3&gt;&lt;p&gt;The WebLogic console can be deployed and accessed to manage the Integrated WLS (or "DefaultServer").&lt;br /&gt;&lt;/p&gt;&lt;p class="subhead2"&gt;To view the DefaultServer details:&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Go to your web browser and enter the URL: &lt;span class="italic"&gt;http://&amp;lt;hostname.domainname&amp;gt;:&amp;lt;port&amp;gt;/console&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Login to the WLS console using the username and password: weblogic / weblogic1.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Go to the Domain Structure and select &lt;em&gt;DefaultDomain&lt;/em&gt;, &lt;em&gt;Control&lt;/em&gt;, &lt;em&gt;DefaultServer(admin)&lt;/em&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3&gt;Launch&lt;/h3&gt;When Integrated WSL is started, JDeveloper configure its environment as follows:&lt;br /&gt;&lt;pre&gt;D:\Oracle\MIDDLE~1\JDK160~1\bin\java -client&lt;br /&gt;-Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=512m&lt;br /&gt;-Dweblogic.Name=DefaultServer&lt;br /&gt;-Djava.security.policy=D:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy&lt;br /&gt;-Djavax.net.ssl.trustStore=D:\Oracle\Middleware\wlserver_10.3\server\lib\DemoTrust.jks&lt;br /&gt;...&lt;/pre&gt;For troubleshooting, some of these configuration information can be helpful.  For example, it tells you where the domain home directory is; what server instance's name is;  where the security policy file is read from, etc.  In the following sections, we'll discuss some relevant configuration information and where to find them.&lt;br /&gt;&lt;h3&gt;Which Port the Integrated WLS Is Assigned to?&lt;/h3&gt;If the port display when the Integratede WLS started was buried deeply in the Default server log in JDeveloper or it's simply scroll out of scope, you can still find out which port number it gets assigned to. Look at &lt;em&gt;&amp;lt;listen-port&amp;gt;&lt;/em&gt; element inside &lt;em&gt;config.xml&lt;/em&gt; which is located here:&lt;br /&gt;&lt;pre&gt; $JDEV_USER_HOME/system11.1.1.1.32.53.52/DefaultDomain/config&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;Development Mode or Production Mode&lt;/h3&gt;You can check if the server is in development mode or production mode by looking in the &lt;strong&gt;config.xml&lt;/strong&gt; for the domain.  If config.xml contains the following xml fragment, then it is in production mode:&lt;br /&gt;&lt;pre&gt;&amp;lt;production mode-enabled&amp;gt;true&amp;lt;/production-mode-enabled&amp;gt;&lt;/pre&gt;&lt;br /&gt;For Integrated WLS, its config.xml doesn't contain the above xml fragment.  However, you can find if it's in development mode or not by reading the log message in the Log view.&lt;br /&gt;&lt;h3&gt;Server Credential Store&lt;br /&gt;&lt;/h3&gt;&lt;p&gt;There are two ways application credentials can be merged onto the server credential store.&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;MERGE&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;MERGE will not change any credential that already exists on the server.  For example, if there is a user 'scott' and a password 'tiger' already in the server credential store, and your app wants to change the password for 'scott' to 'foo', it will not work if the mode is MERGE.  In order to be able to overwrite a credential on the server, the mode must be OVERWRITE.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;OVERWRITE&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Overwriting the master credential store with application credentials is a security risk.&lt;/li&gt;&lt;li&gt;The overwrite operation will only work on servers in development mode and also have the overwrite option enabled.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;By default, the Integrated WLS is in development mode with OVERWRITE (i.e., -Djps.app.credential.overwrite.allowed=true) flag enabled.&lt;br /&gt;&lt;h3&gt;Troubleshooting Web Services on Integrated WLS&lt;br /&gt;&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Log directory&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;$JDEV_USER_HOME/system11.1.1.1.32.53.52/DefaultDomain/servers/DefaultServer/logs&lt;/li&gt;&lt;li&gt;Look for &lt;em&gt;DefaultDomain.log&lt;/em&gt;, &lt;em&gt;DefaultServer-diagnostic.log&lt;/em&gt;, and &lt;em&gt;DefaultServer.log&lt;/em&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;For more information about logging in Oracle Fusion Middleware, see "&lt;a href="http://fmwdocs.us.oracle.com/doclibs/fmw/E10285_01/core.1111/e10105/logs.htm#ASADM215"&gt;&lt;/a&gt;Managing Log Files and Diagnostic Data" in &lt;a href="http://download.oracle.com/docs/cd/E12839_01/core.1111/e10105.pdf"&gt;&lt;span class="italic"&gt;Oracle Fusion Middleware Administrator's Guide&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;There are two categories of log files that you can reference to assist in diagnosing problems with Web services:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="bold"&gt;Diagnostic logs&lt;/span&gt;--Enable you to access diagnostic data about specific feature components in Oracle Fusion Middleware. For more information, see "Using Diagnostic Logs for Web Services".&lt;br /&gt;&lt;p&gt;There is a set of predefined diagnostic loggers. You can configure your own diagnostic logger, as described in "Configuring a Diagnostic Logger for a Web Service".&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="bold"&gt;Message logs&lt;/span&gt;--Enable you to view elements of the SOAP message request. You control message log creation using policies. For more information, see "Using Message Logs for Web Services".&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Diagnosing Problems with Oracle WSM Policy Manager&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;References&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;Integrated WLS&lt;/li&gt;&lt;li&gt;Running and Deploying Applications on WebLogic Server&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcextservices.htm#CJAJGIEB"&gt;How to Test the Web Service Using Integrated WLS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://fmwdocs.us.oracle.com/doclibs/fmw/E10285_01/doc.1111/e10308/gs_install.htm#sthref38"&gt;How to Manage the Integrated WLS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://download.oracle.com/docs/cd/E15523_01/webcenter.1111/e10148/jpsdg_prep_environment.htm#BABJGEFA"&gt;How to Start and Stop Integrated WLS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Oracle Fusion Middleware Search Results: integrated WLS&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/748094882401183761-8886547988731502610?l=xmlandmore.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnFromNoahsArk/~4/ZTtvytQo0Ys" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://xmlandmore.blogspot.com/feeds/8886547988731502610/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=748094882401183761&amp;postID=8886547988731502610" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/8886547988731502610?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/748094882401183761/posts/default/8886547988731502610?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnFromNoahsArk/~3/ZTtvytQo0Ys/integrated-weblogic-server-wls.html" title="Integrated WebLogic Server (WLS)" /><author><name>Stanley Guan</name><uri>http://www.blogger.com/profile/14903166424561297055</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="20" height="32" src="http://4.bp.blogspot.com/_Y8eLenGvPHg/SpMnXYKpL4I/AAAAAAAAANw/1VF3_9dvSXY/S220/Self.bmp" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-6QY_iz5jz1A/TbeiT4-p3FI/AAAAAAAAAgU/RVuljyX-9Hc/s72-c/IntegratedWLS.JPG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://xmlandmore.blogspot.com/2011/04/integrated-weblogic-server-wls.html</feedburner:origLink></entry></feed>

