<?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-8781568769983982843</id><updated>2024-12-28T07:31:29.301-08:00</updated><category term="maven2"/><category term="Spring"/><category term="cache"/><category term="OSCache"/><category term="alfresco"/><category term="branch"/><category term="chrome"/><category term="datasource"/><category term="eclipse"/><category term="execution"/><category term="extension"/><category term="google"/><category term="hibernate"/><category term="hibernate shards"/><category term="java"/><category term="jaxb"/><category term="jdbc"/><category term="jndi"/><category term="junit"/><category term="maps"/><category term="merge"/><category term="p4win"/><category term="p4wsad"/><category term="perforce"/><category term="plugin"/><category term="svn"/><category term="version control"/><category term="wtp tomcat java"/><category term="xml xsd"/><title type='text'>Frameworks Central</title><subtitle type='html'>All it takes to choose a framework</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-4201802388359804426</id><published>2011-06-19T18:47:00.001-07:00</published><updated>2011-07-15T08:56:04.895-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="chrome"/><category scheme="http://www.blogger.com/atom/ns#" term="extension"/><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="maps"/><title type='text'>MapMe Chrome Extension released!</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; &quot;&gt;&lt;div class=&quot;g-section&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; &quot;&gt;&lt;img class=&quot;detail-logo-128&quot; src=&quot;https://lh6.googleusercontent.com/PWRpoG-7_PfDb2PL-lZLwOaGsMr06bW0w9yMAqaQzTrTKTyatN7pl03E0L60SkTVIkPKbY0L=s128-e365-h128&quot; alt=&quot;Logo&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 92px; height: 92px; float: left; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; &quot; /&gt;&lt;table class=&quot;detail-title-box&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 110px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-collapse: collapse; empty-cells: show; font-size: 15px; width: 410px; height: 92px; line-height: 22px; &quot;&gt;&lt;tbody style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; &quot;&gt;&lt;tr style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; &quot;&gt;&lt;td style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; &quot;&gt;&lt;div class=&quot;detail-title&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 21px; font-weight: bold; &quot;&gt;MapMe&lt;/div&gt;cheng.lee&lt;div class=&quot;detail-price&quot; style=&quot;border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 18px; font-weight: bold; &quot;&gt;Free&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 15px; &quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 15px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;Map location on Google Maps. Just select the text, right click to bring up the context menu and select &#39;Find in Google Maps&#39;.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;div class=&quot;detail-summary&quot; style=&quot;font-family: arial, sans-serif; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 20px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 15px; &quot;&gt;Get it from &lt;a href=&quot;https://chrome.google.com/webstore/detail/pkeibkoopkkbbkgdegbbkjlgmomklbpf&quot;&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;detail-summary&quot; style=&quot;font-family: arial, sans-serif; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 20px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 15px; &quot;&gt;&lt;b&gt;Changelog&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;div class=&quot;detail-summary&quot; style=&quot;font-family: arial, sans-serif; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 20px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 15px; &quot;&gt;Version 1.0.4:&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 15px; &quot;&gt;&lt;ul&gt;&lt;li&gt;Localized for Japanese&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;div class=&quot;detail-summary&quot; style=&quot;font-family: arial, sans-serif; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 20px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 15px; &quot;&gt;Version 1.0.3:&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 15px; &quot;&gt;&lt;ul&gt;&lt;li&gt;Localized for Spanish and Chinese (Traditional and Simplified)&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/4201802388359804426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/4201802388359804426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/4201802388359804426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/4201802388359804426'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2011/06/mapme-chrome-extension-released.html' title='MapMe Chrome Extension released!'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/PWRpoG-7_PfDb2PL-lZLwOaGsMr06bW0w9yMAqaQzTrTKTyatN7pl03E0L60SkTVIkPKbY0L=s72-h128-c-e365" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-7628592491256789371</id><published>2009-05-18T14:22:00.001-07:00</published><updated>2009-05-18T14:28:09.312-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="p4win"/><category scheme="http://www.blogger.com/atom/ns#" term="p4wsad"/><category scheme="http://www.blogger.com/atom/ns#" term="perforce"/><title type='text'>P4WSAD hang up (freezes) in Eclipse</title><content type='html'>While developing in Windows, I&#39;ve found that simple operations like checkout (Open for Edit) would hang up if the p4 client spec is too general (for example //depot/... which basically covering all the depot).&lt;br /&gt;&lt;br /&gt;I believe it has to do with p4 inner working that tries to do something weird besides checking out the source I want. So the solution was to limit the client spec to only the part of the depot I need, for example:&lt;br /&gt;&lt;br /&gt;//depot/project_a/module_a/... //perforce-clients/project_a/module_a/...&lt;br /&gt;//depot/project_a/module_b/... //perforce-clients/project_a/module_b/...&lt;br /&gt;&lt;br /&gt;After this has been done. I&#39;ve been able to checkout a file without any problems.&lt;br /&gt;&lt;br /&gt;Note: the same behavior has been observed in P4Win, so it must have to do with p4 command line client, not the eclipse plugin.</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/7628592491256789371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/7628592491256789371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7628592491256789371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7628592491256789371'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2009/05/p4wsad-hang-up-freezes-in-eclipse.html' title='P4WSAD hang up (freezes) in Eclipse'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-996594833550243774</id><published>2009-04-16T07:36:00.000-07:00</published><updated>2009-04-16T07:46:43.568-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="alfresco"/><title type='text'>How to make Alfresco lucene index store the time part of a datetime field</title><content type='html'>Due to Alfresco bug &lt;a href=&quot;https://issues.alfresco.com/jira/browse/AR-1791&quot;&gt;[#1791] Lucene indexes contain only date not time&lt;/a&gt;, the lucene index in Alfresco only stores the date part of a datetime field. Thought it is fixed from 2.1.1E on, the time is not stored by default in order to maintain backwards compatibility with old indexes.&lt;br /&gt;&lt;br /&gt;To solve this problem you should:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Update your dataTypeAnalyzers.properties (located under &lt;span style=&quot;font-family:courier new;&quot;&gt;WEB-INF/classes/alfresco/model&lt;/span&gt; or &lt;span style=&quot;font-family:courier new;&quot;&gt;config/alfresco/model&lt;/span&gt; if you are using AMP module)&lt;br /&gt;replace:&lt;br /&gt;&lt;br /&gt;d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateAnalyser&lt;br /&gt;&lt;br /&gt;for:&lt;br /&gt;&lt;br /&gt;d_dictionary.datatype.d_datetime.analyzer=org.alfresco.repo.search.impl.lucene.analysis.DateTimeAnalyser&lt;/li&gt;&lt;li&gt;Rebuild your Lucene indexes by adding the following line to &lt;span style=&quot;font-family: courier new;&quot;&gt;&lt;alfresco&gt;/tomcat/shared/classes/alfresco/extension/custom-repository.properties&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;index.recovery.mode=FULL&lt;br /&gt;&lt;br /&gt;Once the rebuild process finishes (look at your log file), remember to remove the line added so you don&#39;t rebuild your indexes every time you restart your webapp&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/996594833550243774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/996594833550243774' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/996594833550243774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/996594833550243774'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2009/04/how-to-make-alfresco-lucene-index-store.html' title='How to make Alfresco lucene index store the time part of a datetime field'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-8999609483011364066</id><published>2009-04-05T10:55:00.000-07:00</published><updated>2009-04-05T11:07:34.075-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="wtp tomcat java"/><title type='text'>How to avoid WTP restart Tomcat after code hotswap</title><content type='html'>This is not really a topic about frameworks rather than a tip while developing in Eclipse WTP. Since the time of Sysdeo Tomcat plugin, Java developers knew that one could change code on the fly and have the code hot-swapped, without having to restart the Tomcat. In the time of WTP, this is not longer true by default but you can re-enable this feature as follows:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Open Server Tab -&gt; Select your app server and right click &quot;Open&quot; -&gt; Publishing, and choose &quot;Never publish automatically&quot;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;We have to do this since the default context.xml that WTP generates forces context reload whenever it detecs changes in WEB-INF/classes. You can check out the server.xml at:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;eclipse&gt;\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Where you will see &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;reloadable=&quot;false&quot;&lt;/span&gt; now&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;context docbase=&quot;C:\Java\eclipse_3_4_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ROOT&quot; path=&quot;/sample&quot; class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;reloadable=&quot;false&quot; &lt;/span&gt;source=&quot;org.eclipse.jst.j2ee.server:sample&quot;/&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/8999609483011364066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/8999609483011364066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/8999609483011364066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/8999609483011364066'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2009/04/how-to-avoid-wtp-restart-tomcat-after.html' title='How to avoid WTP restart Tomcat after code hotswap'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-8103258879567998709</id><published>2009-03-10T09:01:00.000-07:00</published><updated>2009-03-10T09:07:15.541-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="xml xsd"/><title type='text'>XSD Schema validation</title><content type='html'>There are some stuffs that one often configure once and just use it later on. But then it&#39;s hard to recall what has been done for it to work. One such example is setting the XSD schema for validation in XML files so this post is my cheat-sheet to avoid wasting my time looking on the Internet.&lt;br /&gt;&lt;br /&gt;The main source can be found in http://www.xml.com/lpt/a/691&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Dependent on using namespaces, the link will be either:&lt;/p&gt; &lt;pre&gt;&lt;book isbn=&quot;0836217462&quot;&lt;br /&gt; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt; xsi:noNamespaceSchemaLocation=&quot;file:library.xsd&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Or, as below (noting the syntax with a URI for the namespace and the URI of the schema, separated by whitespace in the same attribute):&lt;/p&gt; &lt;pre&gt;&lt;book isbn=&quot;0836217462&quot;&lt;br /&gt; xmlns=&quot;http://example.org/ns/books/&quot;&lt;br /&gt; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt; xsi:schemaLocation=&lt;br /&gt;     &quot;http://example.org/ns/books/ file:library.xsd&quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Note that the &quot;file:&quot; has no triple slash&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/8103258879567998709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/8103258879567998709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/8103258879567998709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/8103258879567998709'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2009/03/xsd-schema-validation.html' title='XSD Schema validation'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-6265901262407806541</id><published>2008-12-13T17:04:00.000-08:00</published><updated>2008-12-13T19:07:22.396-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="branch"/><category scheme="http://www.blogger.com/atom/ns#" term="merge"/><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><category scheme="http://www.blogger.com/atom/ns#" term="version control"/><title type='text'>Branching and Merging with SVN</title><content type='html'>To merge the changes from the trunk to the current directory (we assume that we are working on a branch) we issue this command:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ svn merge -c 344 http://svn.example.com/repos/calc/trunk&lt;br /&gt;U  integer.c&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;After the merge has been done, you can commit the change as usual. At that point, the change has been merged into your repository branch. In version control terminology, this act of copying changes between branches is commonly called porting changes.&lt;br /&gt;When you commit the local modification, make sure your log message mentions that you&#39;re porting a specific change from one branch to another. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ svn commit -m &quot;integer.c: ported r344 (spelling fixes) from trunk.&quot;&lt;br /&gt;Sending        integer.c&lt;br /&gt;Transmitting file data .&lt;br /&gt;Committed revision 360.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This will help you keep track of which changes had been ported so you don&#39;t merge the same changes more than once, especially when you repeatedly merge changes from one branch to another.&lt;br /&gt;&lt;br /&gt;Now, there are times where you wish to preview the merge operation without actually applying the changes because you have local edits, so reverting the files is not an option. Issue this command to do so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ svn merge --dry-run -c 344 http://svn.example.com/repos/calc/trunk&lt;br /&gt;U  integer.c&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This only shows the status codes that would result from a real merge. It&#39;s more concise than the info that svn diff would provide us, and is perfect when we don&#39;t want to be flooded with all the details of the changes. But in case you need the details then you can run the svn diff with the same arguments you passed to svn merge, in our previous example.&lt;br /&gt;&lt;br /&gt;Now an excerpt from &lt;a href=&quot;http://svnbook.red-bean.com/en/1.4/svn.branchmerge.copychanges.html&quot; title=&quot;SVN handbook Chapter 4: Branching and Merging&quot;&gt;SVN handbook Chapter 4: Branching and Merging&lt;/a&gt;&lt;br /&gt;&lt;h3&gt;Merges and Moves&lt;/h3&gt;&lt;br /&gt;A common desire is to refactor source code, especially in Java-based software projects. Files and directories are shuffled around and renamed, often causing great disruption to everyone working on the project. Sounds like a perfect case to use a branch, doesn&#39;t it? Just create a branch, shuffle things around, then merge the branch back to the trunk, right?&lt;br /&gt;&lt;br /&gt;Alas, this scenario doesn&#39;t work so well right now, and is considered one of Subversion&#39;s current weak spots. The problem is that Subversion&#39;s update command isn&#39;t as robust as it should be, particularly when dealing with copy and move operations.&lt;br /&gt;&lt;br /&gt;When you use svn copy to duplicate a file, the repository remembers where the new file came from, but it fails to transmit that information to the client which is running svn update or svn merge. Instead of telling the client, “Copy that file you already have to this new location”, it instead sends down an entirely new file. This can lead to problems, especially because the same thing happens with renamed files. A lesser-known fact about Subversion is that it lacks “true renames”—the svn move command is nothing more than an aggregation of svn copy and svn delete.&lt;br /&gt;&lt;br /&gt;For example, suppose that while working on your private branch, you rename integer.c to whole.c. Effectively you&#39;ve created a new file in your branch that is a copy of the original file, and deleted the original file. Meanwhile, back on trunk, Sally has committed some improvements to integer.c. Now you decide to merge your branch to the trunk:&lt;br /&gt;&lt;br /&gt;$ cd calc/trunk&lt;br /&gt;&lt;br /&gt;$ svn merge -r 341:405 http://svn.example.com/repos/calc/branches/my-calc-branch&lt;br /&gt;D   integer.c&lt;br /&gt;A   whole.c&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;This doesn&#39;t look so bad at first glance, but it&#39;s also probably not what you or Sally expected. The merge operation has deleted the latest version of integer.c file (the one containing Sally&#39;s latest changes), and blindly added your new whole.c file—which is a duplicate of the older version of integer.c. The net effect is that merging your “rename” to the branch has removed Sally&#39;s recent changes from the latest revision!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This isn&#39;t true data-loss; Sally&#39;s changes are still in the repository&#39;s history, but it may not be immediately obvious that this has happened. The moral of this story is that until Subversion improves, be very careful about merging copies and renames from one branch to another.&lt;br /&gt;&lt;br /&gt;Another excerpt from &lt;a href=&quot;http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html&quot; title=&quot;SVN handbook Chapter 4: Common Use-Cases&quot;&gt;SVN handbook Chapter 4: Common Use-Cases&lt;/a&gt;&lt;br /&gt;&lt;h3&gt;Merging a Whole Branch to Another&lt;/h3&gt;&lt;br /&gt;To complete our running example, we&#39;ll move forward in time. Suppose several days have passed, and many changes have happened on both the trunk and your private branch. Suppose that you&#39;ve finished working on your private branch; the feature or bug fix is finally complete, and now you want to merge all of your branch changes back into the trunk for others to enjoy.&lt;br /&gt;&lt;br /&gt;So how do we use svn merge in this scenario? Remember that this command compares two trees, and applies the differences to a working copy. So to receive the changes, you need to have a working copy of the trunk. We&#39;ll assume that either you still have your original one lying around (fully updated), or that you recently checked out a fresh working copy of /calc/trunk.&lt;br /&gt;&lt;br /&gt;But which two trees should be compared? At first glance, the answer may seem obvious: just compare the latest trunk tree with your latest branch tree. But beware—this assumption is wrong, and has burned many a new user! Since svn merge operates like svn diff, comparing the latest trunk and branch trees will not merely describe the set of changes you made to your branch. Such a comparison shows too many changes: it would not only show the addition of your branch changes, but also the removal of trunk changes that never happened on your branch.&lt;br /&gt;&lt;br /&gt;To express only the changes that happened on your branch, you need to compare the initial state of your branch to its final state. Using svn log on your branch, you can see that your branch was created in revision 341. And the final state of your branch is simply a matter of using the HEAD revision. That means you want to compare revisions 341 and HEAD of your branch directory, and apply those differences to a working copy of the trunk.&lt;br /&gt;&lt;br /&gt;Note:&lt;br/&gt;&lt;br /&gt;A nice way of finding the revision in which a branch was created (the “base” of the branch) is to use the --stop-on-copy option to svn log. The log subcommand will normally show every change ever made to the branch, including tracing back through the copy which created the branch. So normally, you&#39;ll see history from the trunk as well. The --stop-on-copy will halt log output as soon as svn log detects that its target was copied or renamed.&lt;br /&gt;&lt;br /&gt;So in our continuing example,&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ svn log -v --stop-on-copy \&lt;br /&gt;          http://svn.example.com/repos/calc/branches/my-calc-branch&lt;br /&gt;…&lt;br /&gt;------------------------------------------------------------------------&lt;br /&gt;r341 | user | 2002-11-03 15:27:56 -0600 (Thu, 07 Nov 2002) | 2 lines&lt;br /&gt;Changed paths:&lt;br /&gt;   A /calc/branches/my-calc-branch (from /calc/trunk:340)&lt;br /&gt;&lt;br /&gt;$&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As expected, the final revision printed by this command is the revision in which my-calc-branch was created by copying.&lt;br /&gt;&lt;br /&gt;Here&#39;s the final merging procedure, then:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$ cd calc/trunk&lt;br /&gt;$ svn update&lt;br /&gt;At revision 405.&lt;br /&gt;&lt;br /&gt;$ svn merge -r 341:405 http://svn.example.com/repos/calc/branches/my-calc-branch&lt;br /&gt;U   integer.c&lt;br /&gt;U   button.c&lt;br /&gt;U   Makefile&lt;br /&gt;&lt;br /&gt;$ svn status&lt;br /&gt;M   integer.c&lt;br /&gt;M   button.c&lt;br /&gt;M   Makefile&lt;br /&gt;&lt;br /&gt;# ...examine the diffs, compile, test, etc...&lt;br /&gt;&lt;br /&gt;$ svn commit -m &quot;Merged my-calc-branch changes r341:405 into the trunk.&quot;&lt;br /&gt;Sending        integer.c&lt;br /&gt;Sending        button.c&lt;br /&gt;Sending        Makefile&lt;br /&gt;Transmitting file data ...&lt;br /&gt;Committed revision 406.&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/6265901262407806541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/6265901262407806541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/6265901262407806541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/6265901262407806541'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2008/12/branching-and-merging-with-svn.html' title='Branching and Merging with SVN'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-4836895778871802963</id><published>2008-12-01T11:38:00.000-08:00</published><updated>2008-12-12T17:29:55.095-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="maven2"/><title type='text'>Improvement to code generated projects</title><content type='html'>In my previous post &lt;a href=&quot;http://frameworkscentral.blogspot.com/2008/12/executing-maven-2-plugin-task-more-than.html&quot;&gt;Executing a maven 2 plugin task more than once&lt;/a&gt; I exhibited an example where it&#39;s possible to run a plugin task a few times to generate several JAXB java beans from a XSD schema. The problem with this approach is that it is still not very intuitive since you&#39;ll find yourself filling your project dir with extra directories for generated src files (&lt;font face=&quot;courier new&quot;&gt;$basedir/packageA&lt;/font&gt; and &lt;font face=&quot;courier new&quot;&gt;$basedir/packageB&lt;/font&gt; in our case). This creates confusion since you&#39;ll soon lose track of these files and attempt to check them in to the respository if you are not careful.&lt;br /&gt;&lt;br /&gt;That being said, I&#39;ll show you a better alternative to organize your projects. To get started, let&#39;s lay out the proposed structure (this time we will have 1 project for each XSD and then another project for the java project that uses them):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;+-my_java_project&lt;br /&gt;| `-src/main/java&lt;br /&gt;| `-src/main/resources&lt;br /&gt;|&lt;br /&gt;+-my_xsd_project_a&lt;br /&gt;| `-src/main/resources&lt;br /&gt;|&lt;br /&gt;`-my_xsd_project_b&lt;br /&gt;  `-src/main/resources&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now, let&#39;s examine the pom.xml used for XSD projects:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;project&amp;gt;&lt;br /&gt;  &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt;  &amp;lt;groupId&amp;gt;com.mycompany&amp;lt;/groupId&amp;gt;&lt;br /&gt;  &amp;lt;artifactId&amp;gt;my_xsd_project_a&amp;lt;/artifactId&amp;gt;&lt;br /&gt;  &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;My Company - Project A&amp;lt;/name&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;  &amp;lt;build&amp;gt;&lt;br /&gt;    &amp;lt;plugins&amp;gt;&lt;br /&gt;      &amp;lt;plugin&amp;gt;&lt;br /&gt;        &amp;lt;groupId&amp;gt;org.jvnet.jaxb2.maven2&amp;lt;/groupId&amp;gt;&lt;br /&gt;        &amp;lt;artifactId&amp;gt;maven-jaxb2-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;        &amp;lt;executions&amp;gt;&lt;br /&gt;          &amp;lt;!-- Configuration for packageA --&amp;gt;&lt;br /&gt;          &amp;lt;execution&amp;gt;&lt;br /&gt;          &amp;lt;goals&amp;gt;&lt;br /&gt;            &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;          &amp;lt;/goals&amp;gt;&lt;br /&gt;          &amp;lt;/execution&amp;gt;&lt;br /&gt;        &amp;lt;/executions&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;!-- Common JAXB configuration --&amp;gt;&lt;br /&gt;        &amp;lt;configuration&amp;gt;&lt;br /&gt;          &amp;lt;!-- Changes the default schema directory --&amp;gt;&lt;br /&gt;          &amp;lt;schemaDirectory&amp;gt;../xml-schemas-project/&amp;lt;/schemaDirectory&amp;gt;&lt;br /&gt;          &amp;lt;extension&amp;gt;true&amp;lt;/extension&amp;gt;&lt;br /&gt;          &amp;lt;generatePackage&amp;gt;com.mycompany.packageA&amp;lt;/generatePackage&amp;gt;&lt;br /&gt;          &amp;lt;generateDirectory&amp;gt;generated-src-packageA&amp;lt;/generateDirectory&amp;gt;&lt;br /&gt;          &amp;lt;schemaIncludes&amp;gt;&lt;br /&gt;          &amp;lt;include&amp;gt;xml-schemas/packageA/packageA.xsd&amp;lt;/include&amp;gt;&lt;br /&gt;          &amp;lt;/schemaIncludes&amp;gt;&lt;br /&gt;        &amp;lt;/configuration&amp;gt;&lt;br /&gt;      &amp;lt;/plugin&amp;gt;&lt;br /&gt;    &amp;lt;/plugins&amp;gt;&lt;br /&gt;  &amp;lt;/build&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that the configuration section has been extracted out of the &amp;lt;execution/&amp;gt; tag since we don&#39;t have any other &amp;lt;execution/&amp;gt; which needs particular configuration, thus we can move the configuration to the global configuration part of the plugin.&lt;br /&gt;&lt;br /&gt;Next, if we run &quot;mvn clean install&quot; we will get a package with the generated classes in it. So, in order to use the generated classes we only need to include the my_xsd_project_a project as a maven2 dependency to my_java_project and that&#39;s it. Here&#39;s an example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;project&amp;gt;&lt;br /&gt;  &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt;  &amp;lt;groupId&amp;gt;com.mycompany&amp;lt;/groupId&amp;gt;&lt;br /&gt;  &amp;lt;artifactId&amp;gt;my_java_project&amp;lt;/artifactId&amp;gt;&lt;br /&gt;  &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;My Company - My Java Project&amp;lt;/name&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;  &amp;lt;dependencies&amp;gt;&lt;br /&gt;    &amp;lt;!-- Dependency to my_xsd_project_a (generated by JAXB) --&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;      &amp;lt;groupId&amp;gt;com.mycompany&amp;lt;/groupId&amp;gt;&lt;br /&gt;      &amp;lt;artifactId&amp;gt;my_xsd_project_a&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!-- Dependency to my_xsd_project_b (generated by JAXB) --&amp;gt;&lt;br /&gt;    &amp;lt;dependency&amp;gt;&lt;br /&gt;      &amp;lt;groupId&amp;gt;com.mycompany&amp;lt;/groupId&amp;gt;&lt;br /&gt;      &amp;lt;artifactId&amp;gt;my_xsd_project_b&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;/dependency&amp;gt;&lt;br /&gt;  &amp;lt;/dependencies&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/4836895778871802963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/4836895778871802963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/4836895778871802963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/4836895778871802963'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2008/12/improvement-to-code-generated-projects.html' title='Improvement to code generated projects'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-2646050292688859734</id><published>2008-12-01T11:17:00.000-08:00</published><updated>2008-12-12T17:25:05.571-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="execution"/><category scheme="http://www.blogger.com/atom/ns#" term="jaxb"/><category scheme="http://www.blogger.com/atom/ns#" term="maven2"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><title type='text'>Executing a maven 2 plugin task more than once</title><content type='html'>For one particular project I needed to execute a task defined by a &lt;a href=&quot;http://maven.apache.org/&quot; title=&quot;maven2&quot;&gt;maven2&lt;/a&gt; plugin more than once. I had to dig around maven site for a few hours to finally arrive at the deep-buried &lt;a href=&quot;http://maven.apache.org/guides/mini/guide-configuring-plugins.html&quot; title=&quot;Using the executions tag&quot;&gt;Using the executions tag&lt;/a&gt; page explaination saying that maven2 supported &amp;lt;executions/&amp;gt; in case you need to run several &amp;lt;execution/&amp;gt; with different configurations. So for saving me the trouble in the future and for you folks, here&#39;s an example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;   &amp;lt;plugin&amp;gt;&lt;br /&gt;     &amp;lt;groupId&amp;gt;org.jvnet.jaxb2.maven2&amp;lt;/groupId&amp;gt;&lt;br /&gt;     &amp;lt;artifactId&amp;gt;maven-jaxb2-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;     &amp;lt;executions&amp;gt;&lt;br /&gt;       &amp;lt;!-- Configuration for packageA --&amp;gt;&lt;br /&gt;       &amp;lt;execution&amp;gt;&lt;br /&gt;         &amp;lt;id&amp;gt;JAXB - packageA&amp;lt;/id&amp;gt;&lt;br /&gt;         &amp;lt;goals&amp;gt;&lt;br /&gt;           &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;         &amp;lt;/goals&amp;gt;&lt;br /&gt;         &amp;lt;configuration&amp;gt;&lt;br /&gt;           &amp;lt;generatePackage&amp;gt;com.mycompany.packageA&amp;lt;/generatePackage&amp;gt;&lt;br /&gt;           &amp;lt;generateDirectory&amp;gt;generated-src-packageA&amp;lt;/generateDirectory&amp;gt;&lt;br /&gt;           &amp;lt;schemaIncludes&amp;gt;&lt;br /&gt;             &amp;lt;include&amp;gt;xml-schemas/packageA/packageA.xsd&amp;lt;/include&amp;gt;&lt;br /&gt;           &amp;lt;/schemaIncludes&amp;gt;&lt;br /&gt;         &amp;lt;/configuration&amp;gt;&lt;br /&gt;       &amp;lt;/execution&amp;gt;&lt;br /&gt;&lt;br /&gt;       &amp;lt;!-- Configuration for packageB --&amp;gt;&lt;br /&gt;       &amp;lt;execution&amp;gt;&lt;br /&gt;         &amp;lt;id&amp;gt;JAXB - packageB&amp;lt;/id&amp;gt;&lt;br /&gt;         &amp;lt;goals&amp;gt;&lt;br /&gt;           &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;         &amp;lt;/goals&amp;gt;&lt;br /&gt;         &amp;lt;configuration&amp;gt;&lt;br /&gt;           &amp;lt;generatePackage&amp;gt;com.mycompany.packageB&amp;lt;/generatePackage&amp;gt;&lt;br /&gt;           &amp;lt;generateDirectory&amp;gt;generated-src-packageB&amp;lt;/generateDirectory&amp;gt;&lt;br /&gt;           &amp;lt;schemaIncludes&amp;gt;&lt;br /&gt;             &amp;lt;include&amp;gt;xml-schemas/packageB/packageB.xsd&amp;lt;/include&amp;gt;&lt;br /&gt;           &amp;lt;/schemaIncludes&amp;gt;&lt;br /&gt;         &amp;lt;/configuration&amp;gt;&lt;br /&gt;       &amp;lt;/execution&amp;gt;&lt;br /&gt;     &amp;lt;/executions&amp;gt;&lt;br /&gt;  &lt;br /&gt;     &amp;lt;!-- Common JAXB configuration --&amp;gt;&lt;br /&gt;     &amp;lt;configuration&amp;gt;&lt;br /&gt;       &amp;lt;!-- Changes the default schema directory --&amp;gt;&lt;br /&gt;       &amp;lt;schemaDirectory&amp;gt;../xml-schemas-project/&amp;lt;/schemaDirectory&amp;gt;&lt;br /&gt;       &amp;lt;extension&amp;gt;true&amp;lt;/extension&amp;gt;&lt;br /&gt;     &amp;lt;/configuration&amp;gt;&lt;br /&gt;   &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/2646050292688859734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/2646050292688859734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/2646050292688859734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/2646050292688859734'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2008/12/executing-maven-2-plugin-task-more-than.html' title='Executing a maven 2 plugin task more than once'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-7886771089519318696</id><published>2008-12-01T04:07:00.000-08:00</published><updated>2008-12-01T04:42:33.544-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="datasource"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jdbc"/><category scheme="http://www.blogger.com/atom/ns#" term="jndi"/><category scheme="http://www.blogger.com/atom/ns#" term="junit"/><category scheme="http://www.blogger.com/atom/ns#" term="maven2"/><title type='text'>Working with JDBC datasources with Maven2</title><content type='html'>During my career I&#39;ve seen too many database-driven &lt;a href=&quot;http://maven.apache.org/&quot;&gt;maven2&lt;/a&gt; projects that use &lt;a href=&quot;http://maven.apache.org/guides/getting-started/index.html#How_do_I_filter_resource_files&quot;&gt;maven 2 filtering of resources&lt;/a&gt; for jdbc properties in order to externalize the username, password, jdbc url and other JDBC specific configuration to $USER/.m2/settings.xml. The problem with this approach is that we become locked-in to maven2 and won&#39;t be able to run a simple &lt;a href=&quot;http://www.junit.org/&quot;&gt;JUnit&lt;/a&gt; test without first running &quot;mvn clean install&quot;, so that the placeholders in jdbc properties file get replaced with the appropriate values from settings.xml.&lt;br /&gt;&lt;br /&gt;In my opinion, jdbc properties file should be avoided at all if possible. In a &lt;span style=&quot;font-weight: bold;&quot;&gt;web application&lt;/span&gt; for example, it&#39;s possible to create a datasource at the container (e.g. Tomcat) and then reference this datasource from the application via JNDI. By doing this, we can happily use JDBC datasources without having to run &quot;mvn clean install&quot;, making the life for those folks building inside Eclipse much easier.&lt;br /&gt;&lt;br /&gt;Now, we don&#39;t always want to run our code inside a container. One such example is when we are running unit tests. For those cases we should create a base JUnit class that is specific to our module, say &quot;MyProjectModuleTestCase&quot; and inject JNDI datasource as explained in Randy Carver&#39;s blog post &lt;a href=&quot;http://blogs.sun.com/randystuph/entry/injecting_jndi_datasources_for_junit&quot;&gt;Injecting JNDI datasources for JUnit Tests outside of a container&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/7886771089519318696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/7886771089519318696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7886771089519318696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7886771089519318696'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2008/12/working-with-jdbc-datasources-with.html' title='Working with JDBC datasources with Maven2'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-7249694508452072375</id><published>2008-06-11T12:43:00.000-07:00</published><updated>2008-06-11T13:00:18.184-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cache"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><title type='text'>Spring cache module catcha!</title><content type='html'>Caching using JDK 5.0 annotation with Spring seems to be easy. It has a catcha though, when you use the @Cacheable annotation in the second-level call of the object you want to cache. Let me explain it with an example. Consider this class:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;class SampleRepositoryXmlImpl implements SampleRepository {&lt;br /&gt;  public Set&lt;Sample&gt; getSamples(int n) {&lt;br /&gt;    Set&lt;Sample&gt; samples = this.getSamplesFromDisk();&lt;br /&gt;    return getUpToNRandomSamplesFromSet(n, samples);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  @Cacheable(groups=&quot;someCacheableGroup&quot;)&lt;br /&gt;  public Set&lt;Sample&gt; getSamplesFromDisk() {&lt;br /&gt;    ...&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;See, the innocent call to getSamplesFromDisk() from getSamples() should get invoked only when the return value expires in the cache. But let&#39;s see how Spring&#39;s JdkDynamicAopProxy works (excerpt from Spring&#39;s source code JdkDynamicAopProxy:189):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  // Get the interception chain for this method.&lt;br /&gt;  List chain = this.advised.getInterceptorsAndDynamicInterceptionAdvice(method, targetClass);&lt;br /&gt;&lt;br /&gt;  // Check whether we have any advice. If we don&#39;t, we can fallback on direct&lt;br /&gt;  // reflective invocation of the target, and avoid creating a MethodInvocation.&lt;br /&gt;  if (chain.isEmpty()) {&lt;br /&gt;    // We can skip creating a MethodInvocation: just invoke the target directly&lt;br /&gt;    // Note that the final invoker must be an InvokerInterceptor so we know it does&lt;br /&gt;    // nothing but a reflective operation on the target, and no hot swapping or fancy proxying.&lt;br /&gt;    retVal = AopUtils.invokeJoinpointUsingReflection(target, method, args);&lt;br /&gt;  } else {&lt;br /&gt;    // We need to create a method invocation...&lt;br /&gt;    invocation = new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);&lt;br /&gt;    // Proceed to the joinpoint through the interceptor chain.&lt;br /&gt;    retVal = invocation.proceed();&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The &quot;if (chain.isEmpty)&quot; condition block evaluates to true when getSamples() is invoked but then in the inner call to getSamplesFromDisk(), the same condition block evaluates to false since it determines that there is no more chain, thus invokes the method directly, ignoring the interceptor created by @Cacheable annotation!&lt;br /&gt;&lt;br /&gt;For now, to avoid the problem, you should only tag methods as @Cacheable only in the most external level call of the object. If necessary, refactor your code and extract the method to a Strategy object.</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/7249694508452072375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/7249694508452072375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7249694508452072375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7249694508452072375'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2008/06/spring-cache-module-catcha.html' title='Spring cache module catcha!'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-6830473903643530010</id><published>2008-06-03T06:26:00.000-07:00</published><updated>2008-06-11T12:58:10.070-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cache"/><category scheme="http://www.blogger.com/atom/ns#" term="OSCache"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><title type='text'>OSCache + Spring Framework</title><content type='html'>Since I didn&#39;t find a good reference to using OSCache with Spring after browsing the web for a day or so I thought that it would be useful to have this posted.&lt;br /&gt;&lt;br /&gt;This example uses source level metadata (JDK 5.0 annotation) to tag methods as cacheable and configure the refreshPeriod for a particular OSCache&#39;s cache group (it&#39;s the same concept as cache region when using OSCache with Hibernate).&lt;br /&gt;&lt;br /&gt;We first tag the methods with annotations:&lt;br /&gt;&lt;pre&gt;@Cacheable(modelId = &quot;&lt;a href=&quot;#testCahing&quot;&gt;testCaching&lt;/a&gt;&quot;)&lt;br /&gt;public List&amp;lt;Listing&amp;gt; getListings() {&lt;br /&gt;// some implementation&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Cacheable(modelId = &quot;&lt;a href=&quot;#testFlushing&quot;&gt;testFlushing&lt;/a&gt;&quot;)&lt;br /&gt;public void saveListings(List&amp;lt;Listing&amp;gt; listing) {&lt;br /&gt;// some implementation&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;And then we add the following to the application-context.xml for Spring:&lt;br /&gt;&lt;pre&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC &quot;-//SPRING//DTD BEAN//EN&quot; &quot;http://www.springframework.org/dtd/spring-beans.dtd&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;beans&amp;gt;&lt;br /&gt;&amp;lt;!-- Domain --&amp;gt;&lt;br /&gt;&amp;lt;bean id=&quot;listingRepositoryXmlImpl&quot;&lt;br /&gt; class=&quot;com.myco.service.ListingRepositoryXmlImpl&quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Cache Setup --&amp;gt;&lt;br /&gt;&amp;lt;bean id=&quot;autoproxy&quot;&lt;br /&gt; class=&quot;org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt; The created cache manager is a singleton instance of&lt;br /&gt; com.opensymphony.oscache.general.GeneralCacheAdministrator&lt;br /&gt;--&amp;gt;&lt;br /&gt;&amp;lt;bean id=&quot;cacheManager&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.provider.oscache.OsCacheManagerFactoryBean&quot;&amp;gt;&lt;br /&gt; &amp;lt;!-- Optional properties --&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;configLocation&quot;&lt;br /&gt;   value=&quot;classpath:oscache.properties&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id=&quot;cacheProviderFacade&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.provider.oscache.OsCacheFacade&quot;&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;cacheManager&quot; ref=&quot;cacheManager&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Cache-feature Weaving --&amp;gt;&lt;br /&gt;&amp;lt;bean id=&quot;cachingAttributeSource&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.annotations.AnnotationCachingAttributeSource&quot;&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id=&quot;cachingInterceptor&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.interceptor.caching.MetadataCachingInterceptor&quot;&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;cacheProviderFacade&quot; ref=&quot;cacheProviderFacade&quot; /&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;cachingAttributeSource&quot;&lt;br /&gt;   ref=&quot;cachingAttributeSource&quot; /&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;cachingListeners&quot;&amp;gt;&lt;br /&gt;   &amp;lt;list&amp;gt;&lt;br /&gt;     &amp;lt;!-- We don&#39;t have any listener for now&lt;br /&gt;       &amp;lt;ref bean=&quot;cachingListener&quot; /&amp;gt;&lt;br /&gt;     --&amp;gt;&lt;br /&gt;   &amp;lt;/list&amp;gt;&lt;br /&gt; &amp;lt;/property&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;cachingModels&quot;&amp;gt;&lt;br /&gt;   &amp;lt;props&amp;gt;&lt;br /&gt;     &amp;lt;!--&lt;br /&gt;       Bean properties are set here for the underlying CachingModel implementation (OsCacheCachingModel).&lt;br /&gt;       Here we are setting the &quot;group&quot; and &quot;refreshPeriod&quot;.&lt;br /&gt;       Note that the PropertyEditor will translate the semicolon separated key-values into a java.util.Map&lt;br /&gt;     --&amp;gt;&lt;br /&gt;&lt;a name=&quot;testCaching&quot;&gt;&lt;/a&gt;&lt;br /&gt;     &amp;lt;prop key=&quot;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;testCaching&lt;/span&gt;&quot;&amp;gt;&amp;lt;!-- Here we map the modelId &quot;testCaching&quot; (Spring) to group &quot;testCache&quot; (OSCache), we also set the refresh period --&amp;gt;&lt;br /&gt;       &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;groups&lt;/span&gt;=testCache;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;refreshPeriod&lt;/span&gt;=5&lt;br /&gt;     &amp;lt;/prop&amp;gt;&lt;br /&gt;   &amp;lt;/props&amp;gt;&lt;br /&gt; &amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id=&quot;cachingAttributeSourceAdvisor&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.interceptor.caching.CachingAttributeSourceAdvisor&quot;&amp;gt;&lt;br /&gt; &amp;lt;constructor-arg ref=&quot;cachingInterceptor&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id=&quot;flushingAttributeSource&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.annotations.AnnotationFlushingAttributeSource&quot;&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id=&quot;flushingInterceptor&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.interceptor.flush.MetadataFlushingInterceptor&quot;&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;cacheProviderFacade&quot; ref=&quot;cacheProviderFacade&quot; /&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;flushingAttributeSource&quot;&lt;br /&gt;   ref=&quot;flushingAttributeSource&quot; /&amp;gt;&lt;br /&gt; &amp;lt;property name=&quot;flushingModels&quot;&amp;gt;&lt;br /&gt;   &amp;lt;props&amp;gt;&lt;br /&gt;     &amp;lt;!-- Refresh period is set here for the underlying CachingModel implementation (OsCacheCachingModel) --&amp;gt;&lt;br /&gt;&lt;a name=&quot;testFlushing&quot;&gt;&lt;/a&gt;&lt;br /&gt;     &amp;lt;prop key=&quot;&lt;span style=&quot;color: rgb(0, 0, 255);&quot;&gt;testFlushing&lt;/span&gt;&quot;&amp;gt;&amp;lt;!-- Here we map the modelId &quot;testFlushing&quot; (Spring) to group &quot;testCache&quot; (OSCache) --&amp;gt;&lt;br /&gt;       &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;groups&lt;/span&gt;=testCache&lt;br /&gt;     &amp;lt;/prop&amp;gt;&lt;br /&gt;   &amp;lt;/props&amp;gt;&lt;br /&gt; &amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id=&quot;flushingAttributeSourceAdvisor&quot;&lt;br /&gt; class=&quot;org.springmodules.cache.interceptor.flush.FlushingAttributeSourceAdvisor&quot;&amp;gt;&lt;br /&gt; &amp;lt;constructor-arg ref=&quot;flushingInterceptor&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/bean&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;br /&gt;And that&#39;s all there is to it. Happy caching!</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/6830473903643530010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/6830473903643530010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/6830473903643530010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/6830473903643530010'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2008/06/oscache-spring-framework.html' title='OSCache + Spring Framework'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-1621352515265499779</id><published>2007-10-21T18:55:00.000-07:00</published><updated>2007-10-21T19:05:54.618-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hibernate"/><title type='text'>Hibernate</title><content type='html'>According to &lt;a href=&quot;http://www.hibernate.org/42.html&quot;&gt;Hibernate Sessions and transactions&lt;/a&gt;, implementing unit of works using &lt;strong&gt;Session-per-conversation&lt;/strong&gt; is preferred over &lt;strong&gt;session-per-request-with-detached-objects&lt;/strong&gt;. In &lt;a href=&quot;http://www.hibernate.org/hib_docs/reference/en/html/transactions.html&quot;&gt;Chapter 11 of hibernate manual&lt;/a&gt;, it&#39;s stated that &lt;strong&gt;CurrentSessionContext&lt;/strong&gt; should be implemented but I haven&#39;t found the example on the wiki. Help?</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/1621352515265499779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/1621352515265499779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/1621352515265499779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/1621352515265499779'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2007/10/hibernate.html' title='Hibernate'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-2980187442353864244</id><published>2007-10-21T18:47:00.000-07:00</published><updated>2007-10-21T18:51:05.338-07:00</updated><title type='text'>Grid computing / distributed computing frameworks</title><content type='html'>&lt;ul&gt;&lt;li&gt;Globus Toolkit: &lt;/li&gt;&lt;li&gt;Terracota: &lt;strong&gt;Transparent&lt;/strong&gt; Clustered JVM&lt;/li&gt;&lt;li&gt;GigaSpaces&lt;/li&gt;&lt;li&gt;Coherence&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/2980187442353864244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/2980187442353864244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/2980187442353864244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/2980187442353864244'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2007/10/grid-computing-distributed-computing.html' title='Grid computing / distributed computing frameworks'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-8124583978788189299</id><published>2007-10-21T15:46:00.000-07:00</published><updated>2007-10-21T19:02:05.708-07:00</updated><title type='text'>Terracota</title><content type='html'>&lt;a href=&quot;http://www.terracotta.org/&quot;&gt;http://www.terracotta.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Doubts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Question&lt;/strong&gt;: What if you don&#39;t want to replicate state through all nodes in the grid? HTTP Session replication can be VERY expensive.&lt;br /&gt;&lt;strong&gt;Answer&lt;/strong&gt;: &lt;a href=&quot;http://www.terracotta.org/confluence/display/orgsite/HTTP+Session+Clustering&quot;&gt;http://www.terracotta.org/confluence/display/orgsite/HTTP+Session+Clustering&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Question&lt;/strong&gt;: How about resources such as JDBC connections? Will each node be able to establish their own connections? Furthermore, can they have their own configurations?&lt;br /&gt;&lt;strong&gt;Answer&lt;/strong&gt;: &lt;a href=&quot;http://www.terracotta.org/confluence/display/orgsite/Hibernate&quot;&gt;http://www.terracotta.org/confluence/display/orgsite/Hibernate&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/8124583978788189299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/8124583978788189299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/8124583978788189299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/8124583978788189299'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2007/10/terracota.html' title='Terracota'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-4374682043905564991</id><published>2007-09-17T22:45:00.000-07:00</published><updated>2007-09-17T23:23:28.346-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hibernate shards"/><title type='text'>Hibernate Shards</title><content type='html'>From: &lt;a href=&quot;http://www.hibernate.org/hib_docs/shards/reference/en/html/shards-shardstrategy.html&quot;&gt;http://www.hibernate.org/hib_docs/shards/reference/en/html/shards-shardstrategy.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;&quot;It&#39;s important to note that if a multi-level object graph is being saved via Hibernate&#39;s cascading functionality, the &lt;strong&gt;ShardSelectionStrategy will only be consulted when saving the top-level object. All child objects will automatically be saved to the same shard as the parent.&lt;/strong&gt; You may find your ShardSelectionStrategy easier to implement if you prevent developers from creating new objects at more than one level in your object hierarchy. You can accomplish this by making your ShardSelectionStrategy implementation aware of the top-level objects in your model and having it throw an exception if it encounters an object that is not in this set. If you do not wish to impose this restriction that&#39;s fine, just remember that if you&#39;re doing attribute-based shard selection, the attributes you use to make your decision need to be available on every object that gets passed to session.save().&quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you were to save child objects in a different shard, will you be able to enforce foreign key constraint? More generally, is it possible to enforce cross-shard integrity reference? Answer below (&lt;a href=&quot;http://www.hibernate.org/hib_docs/shards/reference/en/html/shards-resharding.html&quot;&gt;http://www.hibernate.org/hib_docs/shards/reference/en/html/shards-resharding.html&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&quot;Unfortunately, the problem of changing object-shard mappings becomes even worse once we consider the fact that Hibernate Shards does not support cross-shard relationships (meaning FKs). This limitation prevents us from moving a subset of an object graph from one shard to another.&quot;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/4374682043905564991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/4374682043905564991' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/4374682043905564991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/4374682043905564991'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2007/09/hibernate-shards.html' title='Hibernate Shards'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8781568769983982843.post-7219033288597286503</id><published>2006-12-21T17:17:00.000-08:00</published><updated>2006-12-21T17:21:43.829-08:00</updated><title type='text'>Great openings!</title><content type='html'>And welcome! In this tiny space I write reviews about frameworks I&#39;ve tried and tested, mainly about Java Presentation but some full stack frameworks are also tested. Happy reading!</content><link rel='replies' type='application/atom+xml' href='http://frameworkscentral.blogspot.com/feeds/7219033288597286503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8781568769983982843/7219033288597286503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7219033288597286503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8781568769983982843/posts/default/7219033288597286503'/><link rel='alternate' type='text/html' href='http://frameworkscentral.blogspot.com/2006/12/great-openings.html' title='Great openings!'/><author><name>Cheng Lee</name><uri>http://www.blogger.com/profile/12625693269929055755</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/cheng.lee/Rl5Drm_bI4E/AAAAAAAACoY/mfZFSqmUsiM/s160-c/ElCaNDelColorado.jpg'/></author><thr:total>0</thr:total></entry></feed>