<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-569143433610258481</id><updated>2024-09-10T16:08:08.038-07:00</updated><category term="Connection timeout JAX-WS"/><category term="Custom Button or Link in Force.com (Salesforce)"/><category term="GC Hotspot JVM"/><category term="Hotspot jvm gc"/><category term="Insert Oracle XML Type using Spring JDBC"/><category term="Java Garbage Collection"/><category term="Java HotSpot VM"/><category term="Java Thread Pool"/><category term="Java Thread Pool Implementation"/><category term="Javascript Salesforce.com refresh"/><category term="Javascript update in Salesforce"/><category term="Lightweight JMS. MDP. Message Driven POJOs"/><category term="Lightweight messaging"/><category term="Oracle XMLType Columns. Spring Oracle XMLType"/><category term="Refresh record after update using Javascript in Salesforce or Force.com"/><category term="Request timeout JAX-WS"/><category term="Service call Connection and Request timeouts in the JAX-WS Client implementations"/><category term="Spring JDBC"/><category term="Spring JMS"/><category term="ThreadPoolExecutor"/><category term="java.util.concurrent.ThreadPoolExecutor"/><category term="major and minor gc in java"/><category term="major gc"/><category term="minor gc"/><category term="xsd dtd differences"/><category term="xsd versus dtd"/><category term="xsd vs dtd"/><title type='text'>The Green Tech Street</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-544138452117661137</id><published>2012-04-09T14:56:00.000-07:00</published><updated>2012-04-09T14:58:20.662-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom Button or Link in Force.com (Salesforce)"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript Salesforce.com refresh"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript update in Salesforce"/><category scheme="http://www.blogger.com/atom/ns#" term="Refresh record after update using Javascript in Salesforce or Force.com"/><title type='text'>Refresh Record  on click Custom Button or Link in Force.com (Salesforce) using Javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Create the custom button or link on your object and assign the behavior &quot;Execute Javascript&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Within your Javascript after your implementation (let&#39;s say post updating the record from your javascript code) you can reload the active window which would in turn refresh the record with the latest content for it.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;You can use the following to trigger the window reload.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;
// Updating the record
var result = sforce.connection.update([wi]); 
// Refresh window to refresh and show updated record
if (result[0].getBoolean(&quot;success&quot;)) { 
window.location.reload();
}
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/544138452117661137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/04/refresh-record-on-click-custom-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/544138452117661137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/544138452117661137'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/04/refresh-record-on-click-custom-button.html' title='Refresh Record  on click Custom Button or Link in Force.com (Salesforce) using Javascript'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-5652477726067593584</id><published>2012-03-31T11:26:00.001-07:00</published><updated>2012-04-08T07:50:03.961-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Connection timeout JAX-WS"/><category scheme="http://www.blogger.com/atom/ns#" term="Request timeout JAX-WS"/><category scheme="http://www.blogger.com/atom/ns#" term="Service call Connection and Request timeouts in the JAX-WS Client implementations"/><title type='text'>Set Timeouts for services in JAX-WS Webservice Client</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: black; color: white;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;To set the Service call Connection and Request timeouts&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 18px;&quot;&gt;in the JAX-WS Client implementations&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 18px;&quot;&gt;for specific services, once the Proxy is created we need to do the following:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 18px;&quot;&gt;1. &amp;nbsp;Cast the Proxy to the&lt;b&gt; javax.xml.ws.BindingProvider&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 18px;&quot;&gt;2. &amp;nbsp;Fetch the Request Context (java.util.Map&amp;lt;String, Object&amp;gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 14px; line-height: 18px;&quot;&gt;3. &amp;nbsp;Set the timeout properties, as demonstrated in the following snippet of code below. Please note that the keys for the entries are &lt;/span&gt;&lt;b style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&#39;com.sun.xml.ws.connect.timeout&#39;&lt;/b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; and&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&#39;com.sun.xml.ws.request.timeout&#39;&lt;/b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;, for connection timeout and request timeout respectively, which are added to the RequestContext Map&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;private void setYourServiceCallTimeOut(YourPort yourPort){
  
  if (logger.isDebugEnabled()) {
   logger.debug(&quot;:setYourServiceCallTimeOut(): Entering method.&quot;);
  }
  java.util.Map&lt;string, object=&quot;&quot;&gt; requestContext = ((javax.xml.ws.BindingProvider)docPublisherPort).getRequestContext();
  requestContext.put(&quot;com.sun.xml.ws.connect.timeout&quot;, 15000); 
  requestContext.put(&quot;com.sun.xml.ws.request.timeout&quot;, 15000); 
  if (logger.isDebugEnabled()) {
   logger.debug(&quot;:setYourServiceCallTimeOut():Exiting method.&quot;);
  }
 }
&lt;/string,&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/5652477726067593584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/set-timeouts-for-specific-services-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/5652477726067593584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/5652477726067593584'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/set-timeouts-for-specific-services-in.html' title='Set Timeouts for services in JAX-WS Webservice Client'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-1711382270754474684</id><published>2012-03-30T20:39:00.001-07:00</published><updated>2012-03-31T09:42:45.084-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="xsd dtd differences"/><category scheme="http://www.blogger.com/atom/ns#" term="xsd versus dtd"/><category scheme="http://www.blogger.com/atom/ns#" term="xsd vs dtd"/><title type='text'>DTD and XSD - Primary differences</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Both these mechanisms provide a definition for the XML document, which serves two purposes primarily - Firstly, this is to ensure that the data that makes it past the parsing stage is at least in the right structure and the undesired input is rejected. Secondly, the definition documents the protocol in a standard, formal way, which makes it easier for developers to understand what’s available.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;DTD (Document Type Definition):&lt;/b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
This format defines the elements that may be included in your document, what attributes these elements have and the ordering and nesting of the elements.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;XSD (XML Schema Definition):&lt;/b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
XML Schemas provide a powerful mean to define your XML document structure and the limitations. XML Schemas are themselves XML documents. They reference the XML Schema Namespace and even have their own DTD.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Now, let us look at the 5 most prominent differences:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; table-layout: fixed; width: 617px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 512; mso-width-source: userset; width: 11pt;&quot; width=&quot;14&quot;&gt;&lt;/col&gt;
 &lt;col class=&quot;xl67&quot; style=&quot;mso-width-alt: 10459; mso-width-source: userset; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;/col&gt;
 &lt;col class=&quot;xl67&quot; style=&quot;mso-width-alt: 11593; mso-width-source: userset; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-left: none; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;DTD (Document
  Type Definition)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-left: none; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XSD (XML Schema
  Document)&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;border-top: none; height: 15.0pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Non-XML
  !&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;This
  is a XML as well.&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;20&quot; style=&quot;height: 15.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; height=&quot;20&quot; style=&quot;border-top: none; height: 15.0pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Not
  namespace aware.&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Namespace
  aware.&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;40&quot; style=&quot;height: 30.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; height=&quot;40&quot; style=&quot;border-top: none; height: 30.0pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Inline
  DTDs can be included within the XML document&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Inline
  is not possible&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;40&quot; style=&quot;height: 30.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; height=&quot;40&quot; style=&quot;border-top: none; height: 30.0pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;DTD
  definition applies to the entire xml document&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Can
  describe individual segments&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;60&quot; style=&quot;height: 45.0pt;&quot;&gt;
  &lt;td align=&quot;right&quot; class=&quot;xl65&quot; height=&quot;60&quot; style=&quot;border-top: none; height: 45.0pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Importantly,
  fails to address data typing&lt;/span&gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-left: none; border-top: none; width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Can
  define to the detail of data types (custom complex and primitive types), incorporate inheritance and
  supports packaging and modularization (can be imported/included)&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;0&quot; style=&quot;display: none;&quot;&gt;
  &lt;td style=&quot;width: 11pt;&quot; width=&quot;14&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;width: 215pt;&quot; width=&quot;286&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;width: 238pt;&quot; width=&quot;317&quot;&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/1711382270754474684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/dtd-and-xsd-primary-differences.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/1711382270754474684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/1711382270754474684'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/dtd-and-xsd-primary-differences.html' title='DTD and XSD - Primary differences'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-8955579205015738066</id><published>2012-03-16T08:44:00.000-07:00</published><updated>2012-03-16T08:55:45.301-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Thread Pool"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Thread Pool Implementation"/><category scheme="http://www.blogger.com/atom/ns#" term="java.util.concurrent.ThreadPoolExecutor"/><category scheme="http://www.blogger.com/atom/ns#" term="ThreadPoolExecutor"/><title type='text'>Easy Java Thread Pool Implementation (using java.util.concurrent.ThreadPoolExecutor)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Thread Pool is one of the commonly used implementation in order to improve performance or facilitate handling of complex and time-consuming operations in an efficient manner. As outlined by Oracle (and previously Sun Microsystems) the Thread pools essentially address two different problems: they usually provide improved performance when executing large numbers of asynchronous tasks, due to reduced per-task invocation overhead and they provide means of bounding and managing the resources, including threads, consumed when executing a collection of tasks.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Jdk 5.0 provides a new thread operational control mechanism, the realization of which is within the java.util.concurrent.* package. We have at our disposal the java.util.concurrent.ThreadPoolExecutor class now, which makes the ThreadPool implementation easy and more thorough as the ThreadPoolExecutor not only outlines the concept and makes the feature out of the box, but also maintains some basic statistics, such as the number of completed tasks, etc.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;I am going to illustrate an implementation that I had coded for different migration projects to handle and migrate large volume of data. Threadpooling was an automatic choice for me as I had tight migration windows and time constraints.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;I have a simple wrapper over the java.util.concurrent.ThreadPoolExecutor class, which acts as a helper for the consuming applications to initialize a thread pool with the desired settings and add tasks to the pool (runnable threads).&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;//Java
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
//Apache Logger
import org.apache.log4j.Logger;

/**
 * This executor class is a generic implementation to initialize a thread pool and execute
 * tasks from the desired pool of defined thread class.
 *  
 * @author Somesh Mukherjee
 */
public class BatchThreadPoolExecutor {
    
 public static final Logger log = Logger.getLogger(BatchThreadPoolExecutor.class);
    
 private ThreadPoolExecutor threadPool = null;
    private ArrayBlockingQueue&lt;runnable&gt; queue = null;
 
    /**
     * Default Constructor (Should not be Used)
     */
    @Deprecated
    public BatchThreadPoolExecutor(){
     
     throw new RuntimeException(&quot;Must assign proper values for int poolSize(int), maxPoolSize(int), keepAliveTime(long), queueSize (int)&quot;);
    }
    
    /**
     * ThreadPool initializer constructor.
     * 
     * @param poolSize
     * @param maxPoolSize
     * @param keepAliveTime
     * @param queueSize
     */
    public BatchThreadPoolExecutor(int poolSize, 
           int maxPoolSize,
           long keepAliveTime,
           int queueSize) {
     
     if(0 == poolSize
       || 0 == maxPoolSize
       || 0L == keepAliveTime
       || 0 == queueSize){
      throw new RuntimeException(&quot;Must assign proper values for int poolSize(int), maxPoolSize(int), keepAliveTime(long), queueSize (int)&quot;);
     }
     log.debug(&quot;Initializing BatchThreadPoolExecutor...&quot;);
     queue = new ArrayBlockingQueue&lt;runnable&gt;(queueSize);
     threadPool = new ThreadPoolExecutor(poolSize, 
                 maxPoolSize,
                 keepAliveTime, 
                 TimeUnit.SECONDS, 
                 queue);
    }
 
    /**
     * Fires the individual thread task
     * 
     * @param task
     */
    public void runTask(Runnable task){
     
     log.debug(&quot;Beginning runTask, threadPool.getTaskCount():&quot; + threadPool.getTaskCount());
     log.debug(&quot;runTask, Starting queue.size():&quot; + queue.size());
     threadPool.execute(task);
     log.debug(&quot;runTask, Finishing queue.size():&quot; + queue.size());
    }
 
    /**
     * Shuts down the thread pool. Previously submitted tasks are executed, 
     * but no new tasks will be accepted. Invocation has no additional effect if already shut down.
     */
    public void shutDown(){
     
     log.debug(&quot;Shutting down BatchThreadPoolExecutor...&quot;);
        threadPool.shutdown();
    }
    
    /**
     * An utility method to find out if the thread pooled tasks are complete or if the pool
     * this has active tasks.
     */
    public boolean isTerminated(){
     
     if(threadPool.isTerminated()){
      log.debug(&quot;$$$$ The Thread Pool has Terminated... $$$$&quot;);
     } else {
      log.debug(&quot;###### The Thread Pool has NOT Terminated yet. Active Jobs in the pool: &quot; + threadPool.getActiveCount());
     }
     return threadPool.isTerminated();
    }
}
&lt;/runnable&gt;&lt;/runnable&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Before getting into the code contained within the above wrapper class, I would include one more snippet of code which outlines the mechanism to initialize and spawn the tasks using the above wrapper.&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;//Assume interimDataSetlist is the list containing the data to be processed in a concurrent fashion
if (interimDataSetlist != null &amp;amp;&amp;amp; !interimDataSetlist.isEmpty()) {
     Iterator&lt;batchif&gt; iterator = interimDataSetlist.iterator();
     BatchThreadPoolExecutor mtpe = new BatchThreadPoolExecutor( Integer.parseInt(this.getBatchedThreadPoolSize()),
       Integer.parseInt(this.getBatchedThreadPoolMaxPoolSize()),
       Long.parseLong(this.getBatchedThreadPoolKeepAliveTime()),
       Integer.parseInt(this.getBatchedThreadPoolQueueSize()));
     while (iterator.hasNext()) {
      data = iterator.next();
      if(null != data){
//Enqueue the runnable task here - the createProcessor helper method will simply create an instance of the class with implements the Runnable interface and overrides the run() method with the desired processing implementation
       mtpe.runTask(this.createProcessor(data, this.getProcessorBeanName()));
      }
     }
     //Now the tasks are fired and the pool executor will take care of the execution. Number of max active tasks at one
     //point will be the allowed pool size
     mtpe.shutDown();
     interimDataSetlist = null;
     //Wait for the spawned threaded tasks in the pool to finish to invoke the next batch of tasks
     while(true){
      if(mtpe.isTerminated()){
       log.debug(&quot;Thread pool of Image upload jobs finished! Would initiate the next set if available.&quot;);
       break;
      } else {
       //Pooled tasks in progress, would wait for the batch to finish to trigger the next set of job
       Thread.sleep(busyWaitMS);
      }
     }
    }&lt;/batchif&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;In the illustrated code snippet above, notice line #4, where the wrapper class is instantiated with the attribute settings for the required thread pool. I would give a quick note, so as to what the attributes implicate:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;poolSize - Core thread pool size, allowed to execute concurrently&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;maxPoolSize - Allowed max size for the pool. Core Pool Size must be less than or equal to this. Let&#39;s assume that our poolSize is set to 10 and the maxPoolSize is set to 20, the executor would allow 10 threads to execute concurrently. If more tasks are enqueued, they go into the waiting queue. Hence, in our example, if the runTask fires 20 processor threads, the first 10 executes concurrently, whilst the next 10 processor thread await for them to complete. Please note that you have to careful so as to fire only a certain number of processor threads, which are less than the allowed max pool size, otherwise the processor threads beyond the limit would be Rejected&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;keepAliveTime - Defines the time period the queued processor tasks would be alive. Our wrapper identifies the unit for this as Seconds&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;queueSize - Sets the initialization figure for the pool&#39;s java.util.concurrent.ArrayBlockingQueue, which holds the enqueued processor tasks&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Once the ThreadPoolExecutor is initialized, we fire the runTask (line #12) on the wrapper class, which accepts a Runnable implementation and internally spawns the run() method for the Processor Thread class. The runTask on the wrapper class executes the runTask on the executor.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;After all the processor tasks are enqueued, I am immediately shutting the Executor pool, to stop accepting more Processor tasks (line #17). Please note that, this does not suspend or shut down the spawned tasks, but only marks the pool as saturated and shut to accepting more tasks.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The loop starting line #20, ensures that all the Processor thread tasks enqueued in the pool has finished, by checking the Executor termination using the wrapper class method.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
I hope this articles helps you to build the ThreadPool you are looking for using Java. For any clarifications or if you have any questions, please drop a comment below and I would try to provide more information or a solution. If you notice any discrepancies, please let me know.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Lastly, I would highly appreciate if you like my post, please visit some of the advertisements the sponsors and advertisers have posted on the site :-)&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/8955579205015738066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/easy-java-thread-pool-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/8955579205015738066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/8955579205015738066'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/easy-java-thread-pool-implementation.html' title='Easy Java Thread Pool Implementation (using java.util.concurrent.ThreadPoolExecutor)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-3970751259685897068</id><published>2012-03-12T20:39:00.000-07:00</published><updated>2012-03-12T20:39:28.998-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GC Hotspot JVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Hotspot jvm gc"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Garbage Collection"/><category scheme="http://www.blogger.com/atom/ns#" term="Java HotSpot VM"/><category scheme="http://www.blogger.com/atom/ns#" term="major and minor gc in java"/><category scheme="http://www.blogger.com/atom/ns#" term="major gc"/><category scheme="http://www.blogger.com/atom/ns#" term="minor gc"/><title type='text'>Java Garbage Collection and the Java HotSpot VM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The Garbage Collection model in today’s JVM achieve maximum efficiency incorporating the Generational Garbage Collection Model. This implementation was first introduced in the Java HotSpot VM for Solaris and is widely.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The implementation essentially eliminates the overhead involved in the JVMs attempt to scan through all the objects in the Java heap space, during every single GC attempt. The entire heap space is broken into two Generations, providing distinct and separate memory pools for Long Lived Objects (typically Singletons in a Web container) and Young or New Objects. The newly created Young objects are pushed into the new generation (also called as Eden). If they protrude a longer life then subsequently these are pushed into the old generation.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The GC attempts are classified as either Minor Collections or Major Collections. In the Minor collection the GC passes through the new generation and in the Major collection the GC passes through the entire heap space, including the old generation pool. As evident, the Minor collections are more frequent, as compared to the Major collections, which happen only when the old generation pool runs out of space. During the Major GC the live threads are suspended and may terminate abnormally.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/3970751259685897068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/java-garbage-collection-and-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/3970751259685897068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/3970751259685897068'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/java-garbage-collection-and-java.html' title='Java Garbage Collection and the Java HotSpot VM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-3358195404803757169</id><published>2012-03-12T20:35:00.000-07:00</published><updated>2012-03-23T11:29:32.377-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Insert Oracle XML Type using Spring JDBC"/><category scheme="http://www.blogger.com/atom/ns#" term="Oracle XMLType Columns. Spring Oracle XMLType"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring JDBC"/><title type='text'>Spring JDBC and ORACLE XMLType Columns</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;If you have a table in the Oracle database with a XMLType column and you are using Spring JDBC to write your data access classes, how do you map your XMLType column parameter to the corresponding attribute on the Java DAO layer? I had confronted this and had figured out a implementation to achieve this. Would provide the working, in-production snippet of code segments, which would illustrate the implementation:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;For insertion into database table:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Step1:&lt;/b&gt; Map the parameter on the Java DAO layer to the XMLType SQL attribute:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;declareParameter(new SqlParameter(&quot;YOUR_XMLType_Column_Name&quot;, Types.OTHER));
&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit; font-size: 15px; line-height: 16px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Here, Types is &lt;b&gt;java.sql.Types class&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Step 2:&lt;/b&gt; Set the value for the XMLType column:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;parametersMap.put(
&quot;YOUR_XMLType_Column_Name&quot; , new SqlTypeValue() {
     public void setTypeValue(PreparedStatement cs, int colIndx, int sqlType, String typeName) throws SQLException {
      Connection con = null;
      ((CallableStatement)cs).setObject(colIndx, new XMLType(getNativeJDBCConnection(con,getJdbcTemplate()), yourJavaObject.getXmlTypeValue()));
      if(null != con)
       con.close();
     }
    });
&lt;/pre&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
Assuming&amp;nbsp;parametersMap HashMap carries the input parmeter&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
Here,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
SqlTypeValue is&amp;nbsp;&lt;b&gt;org.springframework.jdbc.core.SqlTypeValue&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
PreparedStatement is&lt;b&gt;&amp;nbsp;java.sql.PreparedStatement&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
SQLException is&amp;nbsp;&lt;b&gt;java.sql.SQLException&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
Connection is&amp;nbsp;&lt;b&gt;java.sql.Connection&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
CallableStatement is&lt;b&gt;&amp;nbsp;java.sql.CallableStatement&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
XMLType is&amp;nbsp;&lt;b&gt;oracle.xdb.XMLType&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;b&gt;getNativeJDBCConnection &lt;/b&gt;helper method&amp;nbsp;derives the native JDBC connection on the basis of the connection type specified. A sample implementation of this method is as follows:&lt;/div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;private Connection getNativeJDBCConnection( Connection con, JdbcTemplate jdbcTemplate ) throws SQLException {
  NativeJdbcExtractorAdapter nativeJdbcExtractorAdapter = null;
  if (connectionType.equalsIgnoreCase(&quot;dbcp&quot;)) {
   nativeJdbcExtractorAdapter = new CommonsDbcpNativeJdbcExtractor();
   con = nativeJdbcExtractorAdapter.getNativeConnection(jdbcTemplate.getDataSource().getConnection());
  } else if (connectionType.equalsIgnoreCase(&quot;websphere&quot;)) {
   nativeJdbcExtractorAdapter = new WebSphereNativeJdbcExtractor();
   con = nativeJdbcExtractorAdapter.getNativeConnection(jdbcTemplate.getDataSource().getConnection());
  } else if (connectionType.equalsIgnoreCase(&quot;weblogic&quot;)) {
   nativeJdbcExtractorAdapter = new WebLogicNativeJdbcExtractor();
   con = nativeJdbcExtractorAdapter.getNativeConnection(jdbcTemplate.getDataSource().getConnection());
  } else {
   con = jdbcTemplate.getDataSource().getConnection();
  }
  return con;
 }
&lt;/pre&gt;
&lt;div&gt;
&lt;b style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;For reading a XMLType column value using a SQL from database table:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: blue; font-size: small;&quot;&gt;
&lt;b style=&quot;color: black; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;In the rowmapper, you can use the way as illustrated in the snippet below to read the XMLType column value:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush: csharp&quot;&gt;if (rs.getObject(MarshForceProcessLogImpl.PROCESS_XML) != null) {    
    OPAQUE opq = ((OPAQUE) rs.getObject(&quot;YOUR_XMLType_Column_Name&quot;));
    XMLType xt = oracle.xdb.XMLType.createXML(opq);
    processXmlData = xt.getStringVal();
   }
&lt;/pre&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
Here,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
OPAQUE is&amp;nbsp;&lt;b&gt;oracle.sql.OPAQUE&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
XMLType is&amp;nbsp;&lt;b&gt;oracle.xdb.XMLType&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: small;&quot;&gt;
I have mostly used code in this segment to describe the way we can use XMLType Oracle columns in Spring JDBC based DAO Java layer. If you have any questions please feel free to drop a note and I can chip in more clarification. Also, if you want the physical java class, I can upload the same and share.&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: small;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: small;&quot;&gt;
Hope this helps!&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/3358195404803757169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/spring-jdbc-and-oracle-xmltype-columns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/3358195404803757169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/3358195404803757169'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/spring-jdbc-and-oracle-xmltype-columns.html' title='Spring JDBC and ORACLE XMLType Columns'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-569143433610258481.post-5335906235220531861</id><published>2012-03-10T13:20:00.000-08:00</published><updated>2012-03-10T19:02:49.436-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lightweight JMS. MDP. Message Driven POJOs"/><category scheme="http://www.blogger.com/atom/ns#" term="Lightweight messaging"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring JMS"/><title type='text'>Lightweight Messaging</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;I have always liked MDBs. But in a very recent project, which was entirely lightweight, I just did not want a EJB container in the frame. So, I looked around… Considered simple Java messaging and it was then that I bumped into MDPs!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;MDPs are the Message Driven POJOs, Spring’s answer to JMS implementations and Asynchronous reception. It ships with a fantastic DefaultMessageListenerContainer and comes in 3 interface implementation options – Conventional JMS MessageListener, Session Aware Message Listener and the Message Listener Adapter. For details, so as to how you can get this up and running please refer -&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://static.springsource.org/spring/docs/2.5.x/reference/jms.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;http://static.springsource.org/spring/docs/2.5.x/reference/jms.html&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Quick, seamless and bingo no EJB container! So, next time you need an Asynchronous infrastructure, give this implementation a thought&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://greentechstreet.blogspot.com/feeds/5335906235220531861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/lightweight-messaging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/5335906235220531861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/569143433610258481/posts/default/5335906235220531861'/><link rel='alternate' type='text/html' href='http://greentechstreet.blogspot.com/2012/03/lightweight-messaging.html' title='Lightweight Messaging'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/07538888062229197328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>